January 2014
Intermediate to advanced
736 pages
70h 43m
English
Figure 4.21 declares and initializes instance variable saveButtonListener, which refers to an anonymous inner class object that implements interface OnClickListener. Line 64 (Fig. 4.20) registered saveButtonListener as saveButtons’s event handler. Lines 76–109 override interface OnClickListener’s onClick method. If the user entered a query and a tag (lines 80–81), lines 83–84 call method addTaggedSearch (Fig. 4.23) to store the tag–query pair and lines 85–86 clear the two EditTexts. Lines 88–90 hide the soft keyboard.
If the user did not enter a query and a tag, lines 92–108 display an AlertDialog indicating ...
Read now
Unlock full access