Android activity jump: Normal jump (Explicit jump, implicit jump) and pass-value jump

Source: Internet
Author: User

Jump for Android activity


1. Normal Jump
@ Explicit Jump
startactivity (New Instent (Activity.this,activity2.class));
NOTE: a---"B---" A (jump to B, press back, return to a)
To jump from one Activity1 to another Activity2, this Activity2 returns to the previous activity1,activity by executing the method: OnCreate (a)---onStart (a)--- Onresume (a)---onPause (a)---onCreate (b)---onStart (b)---onresume (b)---onStop (a)---onPause (b)---onrestart (a)--- OnStart (a)---onresume (a)---onStop (b)---OnDestroy (b)


@ implicit Jump
Customize action to jump through action
startactivity (New Intent (). Setaction ("Custom string Action"));
at the same time, configure the file to configure action and Categroy for Intent-filter in the activity.


2. Jump with return value (useless)
flow back and forth
Startactivityforresult (a)
Setresult (b)
Onactivityresult (a)

Android activity jump: Normal jump (Explicit jump, implicit jump) and pass-value jump

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.