O'Reilly logo

Android™ How to Program, Second Edition by Abbey Deitel, Harvey 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

5.6. QuizFragment Class

Class QuizFragment (Figs. 5.255.34) builds the Flag Quiz’s GUI and implements the quiz’s logic.

 1   // QuizFragment.java 2   // Contains the Flag Quiz logic 3   package com.deitel.flagquiz; 4  5   import java.io.IOException; 6   import java.io.InputStream; 7   import java.security.SecureRandom; 8   import java.util.ArrayList; 9   import java.util.Collections;10   import java.util.List;11   import java.util.Set; 12 13   import android.app.AlertDialog;14   import android.app.Dialog;        15   import android.app.DialogFragment;16   import android.app.Fragment;      17   import android.content.DialogInterface;18   import android.content.SharedPreferences;19   import android.content.res.AssetManager;   ...

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