MainActivity package Statement, import statements and Fields
Class MainActivity
(Fig. 8.14) uses class FragmentTransaction
(imported at line 6) to add and remove the app’s Fragment
s. MainActivity
implements three interfaces:
• ContactListFragment.ContactListFragmentListener
contains callback methods that the ContactListFragment
uses to tell the MainActivity
when the user selects a contact in the contact list or adds a new contact.
• DetailsFragment.DetailsFragmentListener
contains callback methods that the DetailsFragment
uses to tell the MainActivity
when the user deletes a contact or wishes to edit an existing contact.
• AddEditFragment.AddEditFragmentListener
contains callback methods that the AddEditFragment
uses to tell the MainActivity ...
Get Android™ How to Program, Second 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.