Changes

Jump to: navigation, search
Adding the Second Activity
Enter SecondActivity into the Activity Name and Title fields and name the layout file activity_second. Since this activity will not be started when the application is launched (it will instead be launched via an intent by FirstActivity when the button is pressed), it is important to make sure that the Launcher Activity option is disabled before clicking on the Finish button.
Open the layout for the second activity (app -> res -> layout -> activity_second.xml) and drag Open the layout for the second activity (app -> res -> layout -> activity_second.xml) and convert the layout to a ConstraintLayout if necessary. Drag and drop a TextView widget so that it is positioned in the center of the layout. Edit the text of the TextView so that it reads “Second Activity”:
Figure 54-2
<htmlet>androidstudio_a7</htmlet>
 
== Launching the Second Activity ==

Navigation menu