Imagine DogActivity launches an intent for another app to do some work. Such other app can be Camera or Play Billing, etc. After the other app is done it will naturally call DogActivity's onActivityResult. But what if due to some configuration changes or such, DogActivity had been destroyed? What happens? Is this considered a memory leak in the sense that I have leaked the DogActivity Context? Is OnActivityResult of the destroyed DogActivity instance ever actually called?
Asked
Active
Viewed 53 times
0
-
https://stackoverflow.com/questions/10319330/ondestroy-while-waiting-for-onactivityresult I think this should answer your question – Saurabh Oct 30 '18 at 18:27
1 Answers
0
In cases like these, when the Activity A is killed while B is in foreground, when onActivityResult is completed, the system will recreate Activity A. You probably have to use onRestoreInstanceState() to use the data that you previously saved. Hope that helps.

pixelWorld
- 329
- 2
- 17