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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access