Android_ open multiple activity and return to the first activity

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.