• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Activity A --> B --> Camera ==> Crash on moving back to A

vikas.patel

Newbie
Feb 11, 2011
15
0
Hello all,

I've use case like following.
A(startActivityForResult) --> B (startActivityForResult) --> opens camera and take picture, returns picture to B

I successfully get captured picture in activity B.
Now from B --> A it re-creates activity A rather than awaking A's onResume() method. As n when picture is captured by camera, activity A is died.

In emulator it works but on device it crashed while going back.

I think once our application is hidden by external intent (camera application) it stops and recreate once comes in forground.

Please clear me about this flow and what can be solution for this...

Thanx.
 
Android may or may not be killing the Activity based on if it has enough memory or not. This may be why it works on the emulator and not your phone.

With that being said, if it is being killed then when it is called again, the onCreate() get's called, and then onResume(). If the Activity hasn't been killed, then onCreate() gets skipped and only onResume() gets called.

Hope that makes sense, and helps you out!
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones