If an Activity starts another by startActivityForResult(), what happens to that subactivity if the parent is finished?
Asked
Active
Viewed 250 times
1
-
I want to know how u are going to kill the parent activity after leaving the parent activity? – Varun Dec 04 '10 at 17:16
-
Yes, perhaps that's the point. I don't know if that could be done in a manual way. Anyway, there have to be guarantees that the runtime won't kill it..? – cody Dec 04 '10 at 18:04
1 Answers
1
If Activity A calls startActivityForResult()
(starting up Activity B), and A is finished, nothing happens to B, AFAIK.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
-
Ok. that would mean if resources are low, the system may not be able to deliver the results in the callback. But as that would certainly only happen in extreme situations, I can live with that answer. Thanks. – cody Dec 04 '10 at 18:25
-
@cody: In low-memory situations, Activity A is not finished. When the user BACK-buttons out of Activity B, Activity A would be restored from its instance state. An activity is `finish()`'d only if you call `finish()` on it, or the user does it via the BACK button. – CommonsWare Dec 04 '10 at 18:47