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 ?

有帮助吗?

解决方案

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top