Head First Android Development: A Brain-Friendly Guide by Dawn Griffiths & David Griffiths

Head First Android Development: A Brain-Friendly Guide by Dawn Griffiths & David Griffiths

Author:Dawn Griffiths & David Griffiths [Griffiths, Dawn]
Language: eng
Format: azw3
Publisher: O'Reilly Media
Published: 2017-08-09T04:00:00+00:00


Change activity_temp.xml to use a FrameLayout

As you learned back in Chapter 10, when you want to add a fragment to an activity using a fragment transaction, you first need to add a placeholder for the fragment in the activity’s layout. We did this in Chapter 10 by adding a frame layout to the layout, and giving it an ID so we could refer to it in our Java code.

We need to do the same thing with activity_temp.xml. We’ll replace the <fragment> element with a frame layout, and give the frame layout an ID of stopwatch_container. Update your version of activity_temp.xml so that it reflects ours:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.