A problem occurred during multi-activity redirection of Android last night.

Source: Internet
Author: User

In this case, there is a main interface mainactivity, which contains two buttons: mbutton1, mbutton2. press next to jump to activity1 and activity2. there is a button in activity1 mbutton3, jump to activity3, respectively, the redirection method with return values is used. Set the buttons in activity3. if certain conditions are met, the system will jump to activity1 and send the information to activity1. the jump from activity1 to activity3 is good! In activity3, jump toCodeFragment:

 
Clickok = true; intent backintent = new intent (activity3.this, activity1.class); bundle = new bundle (); bundle. putstring ("send", f0.getabsolutepath (); backintent. putextras (bundle); activity3.this. setresult (0, backintent); activity3.this. finish ();

 

Later, I developed activity2, which was careless and bound to activity3 .(Note:When returned in activity3, it is associated with activity1 .)However, when activity2 is associated with activity3 and activity3 meets the trigger condition, activity2 is returned normally. That's strange!

In activity3, intent settings are returned, which are redirected to activity1. Now I am wondering, how can activity3 jump to activity2 after activity2 and activity3 establish an intent jump relationship ???

The source code will be provided in the near future. You are welcome to discuss and test it.

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.