March 2013
Beginner to intermediate
580 pages
16h 11m
English
In a moment, you will create the CrimeListActivity class that is designed to host a CrimeListFragment. First, let’s set up a view for CrimeListActivity.
For CrimeListActivity, you can simply reuse the layout defined in activity_crime.xml (Listing 9.7). This layout provides a FrameLayout as a container view for a fragment, which is then named in the activity’s code.
Listing 9.7 activity_crime.xml is already generic
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/fragmentContainer" android:layout_width="match_parent" android:layout_height="match_parent" />
Because activity_crime.xml does ...
Read now
Unlock full access