"Android Notes" ends another activity in one activity

Source: Internet
Author: User

To end Activity_a as an example in Activity_b:

1. Define a acitivity global static variable in activity_a:

1  Public Static

2. Assign a value to Activity_a in the OnCreate () method of activity_a:

1 acta=this;

3. In Activity_b, when you need to end activity_a, call the following:

1

It can also be implemented in a broadcast way (ignored here, you need to try it yourself)

Reference Original: http://jingyan.baidu.com/article/3c343ff7096ce40d36796375.html

"Android Notes" ends another activity in one 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.