O'Reilly logo

Android™ How to Program, Third Edition by Harvey M. Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.10 ContactsFragment Class

Class ContactsFragment displays the contact list in a RecyclerView and provides a FloatingActionButton that the user can touch to add a new contact.

9.10.1 Superclass and Implemented Interface

Figure 9.31 lists ContactsFragment’s package statement and import statements and the beginning of its class definition. The ContactsFragment uses a LoaderManager and a Loader to query the AddressBookContentProvider and receive a Cursor that the ContactsAdapter (Section 9.11) uses to supply data to the RecyclerView. ContactsFragment implements interface LoaderManager.LoaderCallbacks<Cursor> (line 23) so that it can respond to method calls from the LoaderManager to create the Loader and process the results returned by the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required