January 2014
Intermediate to advanced
736 pages
70h 43m
English
Method onCreateOptionsMenu (Fig. 8.32, lines 133–138) uses its MenuInflater argument to create the menu from fragment_contact_list_menu.xml, which contains the definition of the add (
) menu item. If the user touches that MenuItem, method onOptionsItemSelected (lines 141–152) calls listener’s onAddContact method to notify the MainActivity that the user wants to add a new contact. MainActivity then displays the AddEditFragment (Section 8.7).
132 // display this fragment's menu items133 @Override134 public void onCreateOptionsMenu(Menu ...
Read now
Unlock full access