State of Activity while in onActivityResult question?

In my app I get the following workflow: onCreate onStart onRestoreInstanceState onActivityResult onResume So, yes onActivityResult is called AFTER the onRestoreInstanceState so you can count on the state has been fully restored (unless you do smth in onResume ) If your Activity was not killed by OS while it was in the background, then I assume its state is the same, so you have nothing to worry about. :).

In my app I get the following workflow: onCreate onStart onRestoreInstanceState onActivityResult onResume So, yes onActivityResult is called AFTER the onRestoreInstanceState, so you can count on the state has been fully restored (unless you do smth in onResume). If your Activity was not killed by OS while it was in the background, then I assume its state is the same, so you have nothing to worry about. :).

Thanks, it makes sense that it would work that way but I was just double checking as I can't find it documented anywhere. – steve Feb 21 at 14:06.

After calling startActivityForResult, onSaveInstanceState is called. Android calls this so that if it needs to remove the Activity from memory it can restore it later (either providing the state information in a bundle via onRestoreInstanceState or onCreate). So, although an Activity may still be running after you call startActivityForResult I don't believe you can guarantee it will not be killed by Android once the new Activity has started.So, my question is if Android needs to call onRestoreActivityState or onCreate, will that always be before or after onActivityResult is called?

– steve Feb 20 at 19:46 onActivityResult is more like a listener which is waiting for input, so my good guess is that both activities can be killed without ever having onActivityResult being executed. – Lumis Feb 20 at 19:55.

An activity which launches another activity with startActivityForResult is fully active, just it has lost the focus - i. E it does not recieve touch input. If you would launch a transparent activity with this method you could see that the first activity is still doing its animations etc in the background.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions