Android activity can be started in four ways to record and open activity traps of other applications. androidactivity
Android supports standard, singleTop, singleTask, and singleInstence.
Standard is the most common method to start an activity and the default method. When an activity is started, it will enter the stack top of the returned stack. The system does not care whether the same activity exists in the stack. The method is as follows.
SingleTop is used to determine whether the same activity exists at the top of the stack when the activity starts. If no activity exists, a new activity is created. Otherwise, no activity is created. Instead, use it directly.
When the singleTask method starts an activity, the system first determines whether there is an active instance in the stack. If there is no new instance, the stacks above the existing activity are all taken out of the stack.
When singleInstance is started, a new stack is created. When other programs access this activity and start this activity, the instance is also obtained. All applications access the same instance.
When accessing activity A with singleInstance Startup Mode from application B in the experiment, you must add it to AndroidManifest. xml of application.
<Activity android: name = "com. example. testandroid. BActivity" android: exported = "true">
</Activity>
Android: exported = "true" indicates that the activity can be opened by other applications.
Reference: http://www.cnblogs.com/lwbqqyumidi/p/3793440.html