5.4.8. fragment_quiz.xml Layout
You’ll typically define a layout for each of your Fragments. For each Fragment layout, you’ll add a layout XML file to your app’s res/layout folder(s) and specify which Fragment class the layout is associated with. Note that you do not need to define a layout for this app’s SettingsFragment because its GUI is auto-generated by the inherited capabilities of class PreferenceFragment.
This section presents the QuizFragment’s layout (fragment_quiz.xml). You’ll define its layout file once in the app’s res/layout folder, because we use the same layout for the QuizFragment on all devices and device orientations. Figure 5.12 shows the QuizFragment’s GUI component names.
Fig. 5.12 | Flag Quiz GUI’s components labeled with ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access