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 comment