Setting Up a Second Activity
There is a lot to do in this chapter. Fortunately, some of the grunt work can be done for you by Android Studio’s New Activity wizard.
Before you invoke the magic, open res/values/strings.xml and add all the strings you will need for this chapter.
Listing 6.1 Adding strings (
<resources> ... <string name="incorrect_toast">Incorrect!</string> <string name="warning_text">Are you sure you want to do this?</string> <string name="show_answer_button">Show Answer</string> <string name="cheat_button">Cheat!</string> <string name="judgment_toast">Cheating is wrong.</string> </resources>
Creating a new activity
Creating an activity typically involves touching at least three ...