Android skillfully using the Finish method

Source: Internet
Author: User

In Android app development, when we jump from one activity to another, I use intent;

Eg:intent Intent = new Intent (a.this,b.class);

StartActivity (Intent);

To do so, when we successfully jump to B, when we click on the function menu to return, I successfully returned to the activity of a.

Eg1:intent Intent = new Intent (a.this,b.class);

StartActivity (Intent);

Finish ();

To do so, when we jump from A to B, we click the Back button and our activity jumps to the activity before a.

So when do you add the Finish method?

Business Scenario: For example, in the order list a click New order to enter New Order B activity, click Save, jump to Order details C, in c I click the Back button I want to

Let him return directly to a, so this business scenario EG1 can fulfill our needs.

Android skillfully using the Finish method

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.