android - how to detect recreate after crash vs. recreate after normal activity destruction -


is possible differentiate between following:

a. activity being re-created after having been destroyed os. instance, if device has "don't keep activities" enabled , user sends app background brings foreground again.

b. activity being re-created after app crash.

i don't think there way such don't believe onstop or ondestroy called when activity crashes not 100% sure.

if doesn't, in onstop or ondestroy set shared preference i.e. shutdowncorrectly set true.

then when activity opens, check shared preference shutdowncorrectly run normal code , set shared preference false. if shared preference false when check, means app crashed can run other code.

hope helps.


Comments