MainActivity Method onAddEditCompleted

Method onAddEditCompleted (Fig. 8.23) from the AddEditFragment.AddEditFragmentListener interface is called by the AddEditFragment to notify the MainActivity when the user saves a new contact or saves changes to an existing one. Line 142 pops the AddEditFragment from the back stack. If the app is running on a tablet (line 144), line 146 pops the back stack again to remove the DetailsFragment (if there is one). Then line 147 updates the contact list in the ContactListFragment and line 150 displays the new or updated contact’s details in the rightPaneContainer.

138      // update GUI after new contact or updated contact saved139      @Override140      public void onAddEditCompleted( ...

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.