Android Programming The Big Nerd Ranch Guide, 3rd Edition

(Brent) #1

Chapter 5  Your Second Activity


94

You should then see a dialog like Figure 5.4. Set Activity Name to CheatActivity. This is the name of
your Activity subclass. Layout Name will be automatically set to activity_cheat. This will be the
base name of the layout file the wizard creates.


Figure 5.4  The New Empty Activity wizard


The defaults for the remaining fields are fine, but take care to ensure that the package name is what you
expect. This determines where CheatActivity.java will live on the filesystem. Click the Finish button
to make the magic happen.


Now it is time to make the UI look good. The screenshot at the beginning of the chapter shows you
what CheatActivity’s view should look like. Figure 5.5 shows the widget definitions.

Free download pdf