Android apps typically have more than one activity, and multiple activities make up the activity stack, with the activity currently at the top of the stack. Activity is equivalent to a servlet for Java web development. When activity is running on Android apps, it is also controlled by the system and has a lifetime.
4.1 Setting up, configuring, and using activity
4.1.1 Activity building its own activity requires the integration of activity base classes, which can sometimes be integrated into the activity's subclasses in different scenarios.
Activity indirectly or directly inherits the base classes of context, Contextwrapper, contextthemewrapper, etc., and can call their methods directly.
Creating an activity requires implementing one or more methods, the most common of which is the OnCreate () method, which then calls the Setcontentview () method to display the view to be displayed when the activity is created with a callback. The Findviewbyid () method gets the components in the interface.
( source \04\4.1\otheractivity)
4.1.2 Configuring an Activity Android app requires that all application components be explicitly configured.
4.1.3 start, close activity with finish () method End ( source \04\4.1\startactivity)
4.1.4 uses bundles to exchange data between activity: The Messenger intent,intent between the activity provides multiple overloaded methods to carry data.
( source \04\4.1\bundletest)
4.1.5 Start other activity and return results
( source \04\4.1\activityforresult)
Callback mechanism of 4.2 activity
4.3 Activity's life cycle and loading mode
Activity is managed by Android in the form of an activity stack, and the activity currently active is at the top of the stack. Activity has roughly 4 states: active, paused, stopped, destroyed.
The life cycle of 4.3.1 activity P263
Similarities and differences between activity and servlet in 4.3.2
4 modes of loading for 4.3.3 activity
4.4 Fragment Detailed
4.4.1 Fragment Overview
4.4.2 Creating fragment
( source \04\4.4\fragmenttest)