Sunshine App : Content Provider – Query

github: S0901- ContentProviderFoundation

* Reference: Udacity Nanodegree Program- Become an Android Developer *

  • Add the Content Provider to the Manifest
  • Setup the URIMatcher

  • Initialize the Content Provider
    • In this case, because the underlying data structure is a SQLite database, you need to make a connection to that database in the onCreate method
  • Code Query
    • It’s important to set the notification URI for the cursor. We’ll use this later when we implement a class called the CursorLoader.

cursor.setNotificationUri(getContext().getContentResolver(), uri);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s