January 2014
Intermediate to advanced
736 pages
70h 43m
English
When the game ends, the showGameOverDialog method (Fig. 6.16) displays a DialogFragment (using the techniques you learned in Section 5.6.9) containing an AlertDialog that indicates whether the player won or lost, the number of shots fired and the total time elapsed. The call to method setPositiveButton (lines 433–444) creates a reset button for starting a new game.
414 // display an AlertDialog when the game ends415 private void showGameOverDialog(final int messageId)416 {417 // DialogFragment to display quiz stats and start new quiz418 final DialogFragment gameResult =419 new DialogFragment() 420 {421 // create ...
Read now
Unlock full access