Activity Four startup modes and activity Four modes
Four startup modes of Activity
In the process of project development, the jump of each Activity in the application will be involved. Some activities can be reused without repeated loading to save memory usage.
Modify the Startup Mode of the second Activity. You can set the launchMode attribute in the AndroidManifest. xml file of the function list.
1). the starndard standard job stack mode is arranged in one-to-one mode (default startup mode)
2). singleTop
If this mode is set on the interface to be enabled, first check whether it is at the top of the task stack. If it is already at the top, reuse the current top, no longer create a new one that is not at the top, and then create a new
Application instance:
Browser bookmarks
To save memory
3). singleTask
If the activated Activity is already in the task stack, all the activities above it will be killed when you enable it again, and you will not be able to create a new Activity.
Application instance:
Browser BrowserActivity
4). singleInstance
If this method is used, the activated Activity is placed in a task stack separately, and only such an instance exists in the task stack.
If an interface is a public interface, any interface can be opened.
Application instance:
Laiphone' Interface
Kingsoft