Changes

Jump to: navigation, search

Using Fragments in Android - A Worked Example

76 bytes removed, 16:28, 3 July 2014
Adding the Fragments to the Activity
== Adding the Fragments to the Activity ==
The main activity for the application has associated with it an XML layout file named activity_fragment_example.xml. For the purposes of this example, the fragments will be added to the activity using the <fragment> element within this file. Using the Package Explorer panel, navigate to the res -> layout section of the FragmentExample project and double click on the activity_fragment_example.xml file to load it into the Graphical Layout tool. Switch from the graphical view to XML by clicking on the activity_fragment_example.xml tab at the bottom of the layout panel. Modify the XML to remove the default TextView object, any padding properties and to embed the two fragments so that it reads as follows:
<pre>

Navigation menu