Changes

Jump to: navigation, search
no edit summary
When the project was created, we instructed Android Studio also to create an initial activity named AndroidSampleActivity. As is evident from the above code, the AndroidSampleActivity class extends, and is therefore a subclass of, the ActionBarActivity class.
A review of the reference documentation for the ActionBarActivity class would reveal that it is itself a subclass of the Activity class. This can be verified within the Android Studio editor using the Hierarchy tool window. With the AndroidSampleActivity.java file loaded into the editor, click on ActionBarActivity in the public class declaration line and press the Ctrl-H keyboard shortcut. The hierarchy tool window will subsequently appear displaying the class hierarchy for the selected class. As illustrated in Figure 9 -1, ActionBarActivity is clearly subclassed from the FragmentActivity class which is itself a subclass of the Activity class:
[[Image:android_studio_hierarchy_tool_window.png|The Android Studio Class Hierarchy window]]
Figure 9-1
[[Image:android_activity_lifecycle_methods.png|The Android lifetime and lifecycle diagram]]
Figure 9-2

Navigation menu