Displaying a List of Runs Using CursorAdapter

To set the ground work for a user interface listing the runs, create a new default activity for the app called RunListActivity and set it as the default in the manifest. Ignore the error about RunListFragment for the moment.

Listing 34.11  The great and powerful RunListActivity (RunListActivity.java)

public class RunListActivity extends SingleFragmentActivity {

    @Override
    protected Fragment createFragment() {
        return new RunListFragment();
    }

}

Listing 34.12  Configuring RunListActivity (AndroidManifest.xml)

<application
  android:allowBackup="true"
  android:icon="@drawable/ic_launcher"
  android:label="@string/app_name"
  android:theme="@style/AppTheme">
  <activity android:name=".RunActivity"
  <activity android:name=".RunListActivity" ...

Get Android Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.