Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)
Declaring activities in the manifest Declaring activities in the manifest The manifest is an XML file containing metadata that d ...
Chapter 5 Your Second Activity Adding a cheat button to QuizActivity The plan is for the user to press a button in QuizActivity ...
Starting an Activity Reopen QuizActivity.java. Add a variable, get a reference, and set a View.OnClickListener stub for the CHEA ...
Chapter 5 Your Second Activity In particular, it is sent to a part of the OS called the ActivityManager. The ActivityManager th ...
Passing Data Between Activities Within mCheatButton’s listener, create an Intent that includes the CheatActivity class. Then pas ...
Chapter 5 Your Second Activity When the user presses the Back button to return to the QuizActivity, the CheatActivity will be d ...
Using intent extras An activity may be started from several different places, so you should define keys for extras on the activi ...
Chapter 5 Your Second Activity In CheatActivity, retrieve the value from the extra in onCreate(Bundle) and store it in a member ...
Getting a result back from a child activity This code is pretty straightforward. You set the TextView’s text using TextView.setT ...
Chapter 5 Your Second Activity Setting result codes is useful when the parent needs to take different action depending on how t ...
Getting a result back from a child activity Then, when the user presses the Back button to return to the QuizActivity, the Activ ...
Chapter 5 Your Second Activity The final step is to override onActivityResult(int, int, Intent) in QuizActivity to handle the r ...
How Android Sees Your Activities Finally, modify the checkAnswer(boolean) method in QuizActivity to check whether the user cheat ...
Chapter 5 Your Second Activity Listing 5.18 QuizActivity declared as launcher activity (AndroidManifest.xml) <manifest xmln ...
How Android Sees Your Activities If you run GeoQuiz and press Back from the QuizActivity, the QuizActivity will be popped off th ...
Chapter 5 Your Second Activity What you are seeing here is that the ActivityManager maintains a back stack and that this back s ...
6. Android SDK Versions and Compatibility Now that you have gotten your feet wet with GeoQuiz, let’s review some background mate ...
Chapter 6 Android SDK Versions and Compatibility The percentage of devices using each version changes constantly, of course, bu ...
A sane minimum One of the biggest changes for Android developers came with the release of Honeycomb, Android 3.0. This release w ...
Chapter 6 Android SDK Versions and Compatibility In addition to the minimum supported version, you can also set the target vers ...
«
2
3
4
5
6
7
8
9
10
11
»
Free download pdf