March 2013
Beginner to intermediate
580 pages
16h 11m
English
In CriminalIntent, you have been hosting fragments by adding them in the activity’s code.
In HelloMoon, you are going to use a layout fragment instead.
When you use a layout fragment, you specify the fragment class in a fragment element.
Open activity_hello_moon.xml and replace its contents with the fragment element shown in Listing 13.4.
Listing 13.4 Creating a layout fragment (activity_hello_moon.xml)
<?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/helloMoonFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.bignerdranch.android.hellomoon.HelloMoonFragment"> </fragment>
There is only one change ...
Read now
Unlock full access