O'Reilly logo

Android™ How to Program, Third Edition by Harvey M. Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.7 MainActivityFragment Class

Class MainActivityFragment (Figs. 4.324.42)—a subclass of the Android Support Library’s Fragment class (package android.support.v4.app)—builds the Flag Quiz’s GUI and implements the quiz’s logic.

4.7.1 package and import Statements

Figure 4.32 shows the MainActivityFragment package statement and import statements. Lines 5–36 import the various Java and Android classes and interfaces that the app uses. We’ve highlighted the key import statements, and we discuss the corresponding classes and interfaces in Section 4.3 and as they’re encountered in Sections 4.7.24.7.11.

 1   // MainActivityFragment.java 2   // Contains the Flag Quiz logic 3   package com.deitel.flagquiz; 4 5   

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required