January 2014
Intermediate to advanced
736 pages
70h 43m
English
To display the Cursor’s results in a ListView we create a new CursorAdapter object (lines 70–73) which exposes the Cursor’s data in a manner that can be used by a ListView. SimpleCursorAdapter is a subclass of CursorAdapter that’s designed to simplify mapping Cursor columns directly to TextViews or ImagesViews defined in your XML layouts. To create a SimpleCursorAdapter, you first define arrays containing the column names to map to GUI components and the resource IDs of the GUI components that will display the data from the named columns. Line 70 creates a String array indicating that only the "name" column will be displayed, and line 71 creates a parallel int array containing ...
Read now
Unlock full access