Graphics Programs Reference
In-Depth Information
are an advanced Android developer, you can extend these responses
later, but right now they are sufficient.
Since the list is displayed in the same order as the items inside the options.xml
file ( string-array in Listing 2-1 contains this list), it becomes easy to create if
blocks to handle each clicked item according to its position in the list.
Inside the if block for “High Score” and “Edit Player” items ( Listing 2-2 ), there
are lines of code to invoke a dialog, which has some styling applied to it, which is
defined in the res/layout folder. The dimens.xml and strings.xml files inside
the res/values folder contain the padding-dimensions and the text (respectively) for
the dialogs. Figures 2-7 and 2-8 show these dialogs.
Figure 2-7 . Game menu: high score
 
 
Search WWH ::




Custom Search