January 2014
Intermediate to advanced
736 pages
70h 43m
English
Figure 4.24 declares and initializes instance variable itemClickListener, which refers to an anonymous inner-class object that implements interface OnItemClickListener. Line 67 (Fig. 4.20) registered itemClickListener as the ListView’s event handler that responds when the user touches an item in the ListView. Lines 131–145 override interface OnItemClickListener’s onItemClick method. The method’s arguments are:
• The AdapterView where the user touched an item. The ? in AdapterView<?> is a wildcard in Java generics indicating method onItemClick can receive an AdapterView that displays any type of data—in this case, a ListView<String>.
• The ...
Read now
Unlock full access