5.6. QuizFragment Class
Class QuizFragment
(Figs. 5.25–5.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; ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.