1 ,activity
(1) An activity is usually a separate screen (window), simply speaking , Activity is an interactive interface, and the general application consists of one or more Activity composition.
(2)communication between Activity through Intent .
(3)every Activity in an Android application must be declared in the androidmanifest.xml configuration file, or the system will not recognize or perform the Activity.
(4) life cycle of Activity
a activation sequence of Activity:
OnCreate ()-->onstart ()-->onresume ()
when another when Activity starts :
first one Activity OnPause ()--> Second activity onCreate ()-->onstart ()-->onresume ( )
--> First Activity onStop ()
when you return to the first when Activity:
a second Activity OnPause ()- -> First Activity Onrestart ()-->onstart ()-->onresume ()--> Second Activity onStop ()-->ondestroy ()
2.Activity Status
generally think Activity has the following four statuses:
active: When a Activity at the top of the stack, it is visible, focused, acceptable user input. Android tries to keep it active as much as possible, killing other activities to ensure that the active activity has enough resources to use. When another Activity is activated, this will be paused.
pause: In many cases, your Activity is visible but it has no focus, in other words it is paused. A possible reason is that a transparent or non-full-screen activity is activated.
when it is paused, a activity will still be active, except that user input is not acceptable. In very special cases,Android will kill a suspended activity to provide sufficient resources for active activity . When an Activity becomes completely hidden, it will become a stop.
stop: When a Activity is not visible, it "stops". This Activity will still save all its status and membership information in memory. However, when memory is needed elsewhere, it will be the most likely to be freed of resources. When an Activity is stopped, an important step is to save the data and the current UI state. Once an Activity exits or shuts down, it becomes a ready-to-use state.
To stay in: in a After the Activity is killed and put in front, it is ready to use. The pending acitivity is removed from the Activity stack and needs to be restarted before it is displayed and available.
Recently, Love Beta (www.ineice.com) launched an Activity component for mobile applications for security vulnerability Detection
Android four components of activity introduction