March 2013
Beginner to intermediate
580 pages
16h 11m
English
Create a new class named CrimeListFragment. Click Browse to choose a superclass. Search for and select ListFragment – android.support.v4.app and then click Finish to generate CrimeListFragment.
ListFragment was introduced in Honeycomb, but it is duplicated in the support library. So compatibility is not a problem as long as you use the support library class, android.support.v4.app.ListFragment.
In CrimeListFragment.java, override onCreate(Bundle) to set the title of the activity that will host this fragment.
Listing 9.4 Adding onCreate(Bundle) to the new fragment (CrimeListFragment.java)
public class CrimeListFragment extends ListFragment {
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...Read now
Unlock full access