5 Your Second Activity

In this chapter, you will add a second activity to GeoQuiz. An activity controls a screen of information, and this activity will add a second screen that offers users a chance to cheat on the current question by showing the answer. Figure 5.1 shows the new activity.

Figure 5.1  CheatActivity offers the chance to peek at the answer

Screenshot shows GeoQuiz app screen.  Text reads, Are you sure you want to do this? Show Answer button is placed below.

If users choose to view the answer and then return to the QuizActivity and answer the question, they will get a new message, shown in Figure 5.2.

Figure 5.2  QuizActivity knows if you’ve been cheating

Get Android Programming: The Big Nerd Ranch Guide, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.