March 2013
Beginner to intermediate
580 pages
16h 11m
English
So far, each of your list items only displays the title of a Crime – the result of Crime.toString().
When you want to display more than just a string, you can create custom list items. Implementing custom list items requires two things:
creating a new layout in XML that defines the view for the list item
creating a subclass of ArrayAdapter<T> that knows how to create, populate, and return the view defined in the new layout
For CriminalIntent, a list item’s layout should include the crime’s title, its date, and whether the case has been solved (Figure 9.11). This layout calls for two TextViews and a CheckBox.
Figure 9.11 A handful of custom list items
You create a new layout for a list item ...
Read now
Unlock full access