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