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 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.