Pregunta

Lets say i have defined two contentProviders in the same Android Manifest and they both are contained in the same package.

When i call: context.getContentResolver()

Which ContentProvider will my CRUD operations flow to ?

¿Fue útil?

Solución

ContentResolver is the one that will decide where the operations go. When you request an operation, the first parameter is a Uri that has an authority and a path in it. The Resolver matches the authority to a single ContentProver and then issues the calls to that provider

Otros consejos

When you run a request on the ContentResolver, you pass in a URI. This is what determines what contentProvider gets called.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top