8.4.8. AddEditFragment’s Layout: fragment_add_edit.xml

When the user touches the action bar items Image or Image, the MainActivity displays the AddEditFragment (Fig. 8.11) with a layout (fragment_add_edit.xml) that uses a ScrollView containing a one-column vertical GridLayout. Be sure to set the ScrollView’s Id to @+id/addEditScrollView. If the AddEditFragment is displayed to add a new contact, the EditTexts will be empty and will display hints (Fig. 8.4). Otherwise, they’ll display the contact’s data that was passed to the AddEditFragment by 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.