Problem of android6.0 adaptation problem--activity destruction

Source: Internet
Author: User

1. Recently I went to run the app developed by our company and found that there were a lot of problems, that is, the previous page will be destroyed after jumping to another page.

Normally, the activity jump process is this:

A: Presence of Intent +setactivityresult (Intent,requestcode) + Pass-through value

B: In the Onbackpress method, use Setresult (resultcode) + Pass value to return the value to the previous page

A: In the Onactivityresult method, by judging the received Resultcode+requestcode, using Getintent to receive the passed value, and then processing

However, in my Nexus 6p, the acitivity jump process is like this:

A: Presence of Intent +setactivityresult (Intent,requestcode) + Pass-through value

B: In the Onbackpress method, use Setresult (resultcode) + Pass value to return the value to the previous page

A: Rerun the OnCreate method so that the previously manipulated data is cleared

A: In the Onactivityresult method, by judging the received Resultcode+requestcode, using Getintent to receive the passed value, and then processing

  

The whole process, in fact I was judged wrong, and I began to judge

If I have this problem on my phone (insufficient conditions necessary), other android6.0 phones have this problem

In fact, my phone set a condition before

Settings-"Developer Options-" app-"do not keep the activity, I chose to tick, so this problem occurs

Therefore, my reflection is that I have a lot of time, need to think fully, or will walk into a dead end

Fortunately, this mistake is wrong, I found myself also gave myself to think.

After the activity has passed in the data, then it is deleted, and finally opened, how does this process retain the previous value?

This is the process that I need to practice.

Problem of android6.0 adaptation problem--activity destruction

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.