Passing Data Between Activities

Now that you have a QuizActivity and a CheatActivity, you can think about passing data between them. Figure 5.9 shows what data you will pass between the two activities.

Figure 5.9  The conversation between QuizActivity and CheatActivity

Illustration shows conversation between QuizActivity and CheatActivity.

The QuizActivity will inform the CheatActivity of the answer to the current question when the CheatActivity is started.

When the user presses the Back button to return to the QuizActivity ...

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.