Android App Development in Android Studio: Java + Android Edition for Beginners by J. Paul Cardle

Android App Development in Android Studio: Java + Android Edition for Beginners by J. Paul Cardle

Author:J. Paul Cardle [Cardle, J. Paul]
Language: eng
Format: epub
Published: 2017-02-03T08:00:00+00:00


CHAPTER 5. ANDRIOD APP #1: RED/BLUE LIGHTHEAD

When an activity is launched, it can exist in various states as shown in

Figure 5.20.

Figure 5.20. Several phases of an activity

As you can see from the figure above, an activity may have several

phases. These phases depend on the activity itself as well as the Android

operating system. For example, if another activity needs a lot of memory,

the current activity may be paused (onPause()) because Android gives

precedence to the other activity.

In the MainActivity.java file of our app, the onCreate() method is

called when the activity is first created. All static set up are done inside

this method.

If we run our app at this stage, we should see the layout we designed. We

can run it in the simulator by hitting the “Run” button and selecting an

emulator as we did in Chapter 3. The Nexus 4 emulator running our app

is shown in Figure 5.21.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.