Android Programming The Big Nerd Ranch Guide, 3rd Edition
Logging the Activity Lifecycle 57 Logging the Activity Lifecycle In this section, you are going to override lifecycle methods to ...
Chapter 3 The Activity Lifecycle 58 Now override five more methods in QuizActivity by adding the following after onCreate(Bundl ...
Using Logcat 59 The parent AppCompatActivity class does not have an onCreat(Bundle) method, so the compiler will complain. This ...
Chapter 3 The Activity Lifecycle 60 In the filter dropdown, select Edit Filter Configuration to create a new filter. Name the f ...
Exploring the activity lifecycle by example 61 When you pressed the Back button, you told Android, “I’m done with this activity, ...
Chapter 3 The Activity Lifecycle 62 Each card in the overview screen represents an app the user has interacted with in the past ...
Rotation and the Activity Lifecycle 63 Rotation and the Activity Lifecycle Let’s get back to the bug you found at the end of Cha ...
Chapter 3 The Activity Lifecycle 64 Creating a landscape layout In the project tool window, right-click the res directory and s ...
Device configurations and alternative resources 65 Finally, ensure that Landscape is selected in the Screen orientation dropdown ...
Chapter 3 The Activity Lifecycle 66 Now make some changes to the landscape layout so that it is different from the default. Fig ...
Device configurations and alternative resources 67 Open layout-land/activity_quiz.xml and make the necessary changes using Figur ...
Chapter 3 The Activity Lifecycle 68 Run GeoQuiz again. Rotate the device to landscape to see the new layout (Figure 3.13). Of c ...
Overriding onSaveInstanceState(Bundle) 69 When you override onCreate(Bundle), you call onCreate(Bundle) on the activity’s superc ...
Chapter 3 The Activity Lifecycle 70 Finally, in onCreate(Bundle), check for this value. If it exists, assign it to mCurrentInde ...
The Activity Lifecycle, Revisited 71 Figure 3.14 The complete activity lifecycle When your activity is stashed, an Activity obj ...
Chapter 3 The Activity Lifecycle 72 For the More Curious: Current State of Activity Cleanup As of this writing, activities them ...
For the More Curious: Log Levels and Methods 73 Now run your app and press the Home button. Pressing Home causes the activity to ...
Chapter 3 The Activity Lifecycle 74 Challenge: Preventing Repeat Answers Once a user provides an answer for a particular questi ...
75 4. Debugging Android Apps In this chapter, you will find out what to do when apps get buggy. You will learn how to use Logcat ...
Chapter 4 Debugging Android Apps 76 Run GeoQuiz and see what happens. Figure 4.1 shows the message that appears when your app c ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf