January 2014
Intermediate to advanced
736 pages
70h 43m
English
In this section, you’ll create the layout for the MainActivity (Section 5.5) that will be used in portrait orientation on all devices. You’ll define the landscape orientation layout for tablets in Section 5.4.9. This layout will display only the QuizFragment (Section 5.6):
1. In the project’s res/layout folder, open activity_main.xml, then follow the steps in Section 2.5.2 to switch from a FrameLayout to a RelativeLayout.
2. From the Palette’s Layouts section, drag a Fragment onto the RelativeLayout node in the Outline window.
3. In the Choose Fragment Class dialog, click Create New... to display the New Java Class dialog.
4. In the dialog’s Name field, enter QuizFragment ...
Read now
Unlock full access