As you can see, referencing all the tables and columns in this API can result in very verbose code. All of the references to Uri elements, tables, and columns in this example are inner classes stemming off of ContactsContract. It is important to verify when interacting with the Contacts API that you are referencing the proper classes, as any Contacts classes not stemming from ContactsContract are deprecated and incompatible.
When the fragment containing the UI for the activity is created, we construct a simple query on the core Contacts table through a CursorLoader referencing Contacts.CONTENT_URI, requesting only the columns we need to wrap the cursor in a ListAdapter. The resulting cursor is displayed in a list on the user interface. The example ...
Get Android Recipes: A Problem-Solution Approach for Android 5.0, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.