Android Programming The Big Nerd Ranch Guide, 3rd Edition
Declaring activities in the manifest 97 Declaring activities in the manifest The manifest is an XML file containing metadata tha ...
Chapter 5 Your Second Activity 98 Adding a cheat button to QuizActivity The plan is for the user to press a button in QuizActiv ...
Starting an Activity 99 Reopen QuizActivity.java. Add a variable, get a reference, and set a View.OnClickListener stub for the C ...
Chapter 5 Your Second Activity 100 In particular, it is sent to a part of the OS called the ActivityManager. The ActivityManage ...
Passing Data Between Activities 101 Within mCheatButton’s listener, create an Intent that includes the CheatActivity class. Then ...
Chapter 5 Your Second Activity 102 When the user presses the Back button to return to the QuizActivity, the CheatActivity will ...
Using intent extras 103 An activity may be started from several different places, so you should define keys for extras on the ac ...
Chapter 5 Your Second Activity 104 In CheatActivity, retrieve the value from the extra in onCreate(Bundle) and store it in a me ...
Getting a result back from a child activity 105 This code is pretty straightforward. You set the TextView’s text using TextView. ...
Chapter 5 Your Second Activity 106 Setting result codes is useful when the parent needs to take different action depending on h ...
Getting a result back from a child activity 107 Then, when the user presses the Back button to return to the QuizActivity, the A ...
Chapter 5 Your Second Activity 108 The final step is to override onActivityResult(int, int, Intent) in QuizActivity to handle t ...
How Android Sees Your Activities 109 Finally, modify the checkAnswer(boolean) method in QuizActivity to check whether the user c ...
Chapter 5 Your Second Activity 110 Listing 5.18 QuizActivity declared as launcher activity (AndroidManifest.xml) <manifest ...
How Android Sees Your Activities 111 If you run GeoQuiz and press Back from the QuizActivity, the QuizActivity will be popped of ...
Chapter 5 Your Second Activity 112 What you are seeing here is that the ActivityManager maintains a back stack and that this ba ...
113 6. Android SDK Versions and Compatibility Now that you have gotten your feet wet with GeoQuiz, let’s review some background ...
Chapter 6 Android SDK Versions and Compatibility 114 The percentage of devices using each version changes constantly, of course ...
A sane minimum 115 One of the biggest changes for Android developers came with the release of Honeycomb, Android 3.0. This relea ...
Chapter 6 Android SDK Versions and Compatibility 116 In addition to the minimum supported version, you can also set the target ...
«
2
3
4
5
6
7
8
9
10
11
»
Free download pdf