Querying a List of Runs From the Database

RunTracker can now insert new runs and locations for them into the database, but as written, RunFragment will create a new run each time you press the Start button. In this section, you will add a new activity and fragment to display a list of runs and to allow the user to create new runs and view existing runs. This is a similar interface to what you implemented in CriminalIntent for the list of crimes, except that the data backing the list will be coming from a database instead of RunTracker’s memory and file data storage mechanism.

Querying a SQLiteDatabase returns an instance of Cursor describing the results. The Cursor API is simple and flexible enough to support any kind of result from any query. ...

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.