Startactivityforresult does not work

Source: Internet
Author: User

Use startactivityforresult to call Activity B from activity,

However, when startactivityforresult is called, the protected void onactivityresult (INT requestcode, int resultcode, intent data) in a is immediately called ),

Read the instructions:

For example, if the activity you
* Are launching uses the singletask launch mode, it will not run in your
* Task and thus you will immediately receive a cancel result.

In this case, B cannot be a single example, that is, launchmode cannot be set as follows:

Android: launchmode = "singleinstance"

Remove the above settings in B, but the same problem still exists,

You can run normally only when the preceding settings are removed from.

Therefore, the singinstance activity can only transmit data in other ways.

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.