I am trying to learn and test exceptions in android and can't seem to get information past try/catch, Thread.currentThread().setUncaughtExceptionHandler(new MyExceptionHandler()) and ACRA.
Basically I want to know what happens when an Exception is thrown, does it kill only the current activity? What if my application has multiple activities and its killed in the 4th activity that is in the stack of activities, does it kill just the one?
I ask mainly because I am throwing an error and its not killing the complete program but restarting it at some middle activity of the program. (I am doing this on purpose to learn more about it) I would either prefer the program dies, than restart in some bad state, but Android has no kill switch (at least that I know of).
Thanks
EDIT: If android recreates the stack, do we know how far it goes? or if it uses create? or resume? What if the previous activities in the stack needed user input?
What I have observed from the LogCat is that android sort of caches the intents and tries to re-construct your stack from those. What I mean is, say you activity stack consists of Activity A, B, C, D (D on top, A at bottom) and an exception is thrown in Activity D. Then the OS tries to reconstruct the stack by firing intents for A, then B and then C. But I'm not sure about it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With