O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5Your Second Activity

In this chapter, you will add a second activity to the GeoQuiz app. An activity controls a screen of information, and this activity will add a second screen that offers users a chance to see the answer to the current question.

Figure 5.1  CheatActivity offers the chance to peek at the answer

CheatActivity offers the chance to peek at the answer

If the user chooses to view the answer and then returns to the QuizActivity and answers the question, he or she will get a new message.

Figure 5.2  QuizActivity knows if you’ve been cheating

QuizActivity knows if you’ve been cheating

Why is this a good Android programming exercise? ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required