MainActivity Method onEditContact
Method onEditContact
(Fig. 8.22) from the DetailsFragment.DetailsFragmentListener
interface is called by the DetailsFragment
to notify the MainActivity
when the user touches the menu item to edit a contact. The DetailsFragment
passes a Bundle
containing the contact’s data so that it can be displayed in the AddEditFragment
’s EditText
s for editing. If the layout contains the fragmentContainer
, line 133 calls displayAddEditFragment
to display the AddEditFragment
in the fragmentContainer
; otherwise, line 135 calls displayAddEditFragment
to display the AddEditFragment
in the rightPaneContainer
.
128 // display the AddEditFragment to edit an existing contact129 @Override130
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.