Introducing Content Resolvers

Each application Context includes a ContentResolver instance, accessible using the getContentResolver method.

ContentResolver cr = getContentResolver();

The Content Resolver includes a number of methods to modify and query Content Providers. Each method accepts a URI that specifies the Content Provider to interact with.

A Content Provider's URI is its authority as defined by its manifest node. An authority URI is an arbitrary string, so most Content Providers include a public content_uri property to publish that authority.

Content Providers usually expose two forms of URI, one for requests against all data, and another that specifies only a single row. The form for the latter appends /<rowiD> to the general content_uri.

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment