Body
First, the process
Ii. Description of the issue
Log in to the level three interface, and then exit back to the login screen.
Iii. Solutions
3.1 Implementation Code
The three-level interface calls the following code:
Intent Intent = new Intent (context, loginview.class);
Intent.setflags (Intent.flag_activity_clear_top);
Context.startactivity (Intent);
3.2 Code Description
If the intent object contains a flag_activity_clear_top tag, when an activity instance with the same activity type that received the intent object already exists in the target task, All activity on the activity object is emptied so that the activity that receives the intent is at the top of the stack and responds to the incoming intent object. If the target activity is running in standard (default) mode, the target activtiy will also be emptied. Because when run mode is standard, a new activity object is always created to receive the incoming intent object.
Iv. issues of attention
Note The source code, the activity at the finish time will determine whether mparent is empty.
V. Articles of reference
4.1 Android's Activity and tasks
4.2 Open multiple activity and return to the first activity
End
The key in this article in the code description that part, it seems that the system needs to study the basic classes such as activity to solve more complex problems.
Ext.: http://www.cnblogs.com/over140/category/253648.html
Android_ open multiple activity and return to the first activity