Domanda

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 ?

È stato utile?

Soluzione

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top