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)

p​u​b​l​i​c​ ​c​l​a​s​s​ ​R​u​n​L​i​s​t​A​c​t​i​v​i​t​y​ ​e​x​t​e​n​d​s​ ​S​i​n​g​l​e​F​r​a​g​m​e​n​t​A​c​t​i​v​i​t​y​ ​{​

 ​ ​ ​ ​@​O​v​e​r​r​i​d​e​
 ​ ​ ​ ​p​r​o​t​e​c​t​e​d​ ​F​r​a​g​m​e​n​t​ ​c​r​e​a​t​e​F​r​a​g​m​e​n​t​(​)​ ​{​
 ​ ​ ​ ​ ​ ​ ​ ​r​e​t​u​r​n​ ​n​e​w​ ​R​u​n​L​i​s​t​F​r​a​g​m​e​n​t​(​)​;​
 ​ ​ ​ ​}​


Listing 34.12  Configuring RunListActivity (AndroidManifest.xml)

<​a​p​p​l​i​c​a​t​i​o​n​ ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.