If my app crashes (reason is unimportant - could be hardware issue, out of memory, whatever), Android always starts my app on the last activity. The app is used by people visiting an office for appointments. When the customer arrives, reception unlocks the app using a code for that client and then the client proceeds through several activities. So, there's client context that is needed for all activities in the app except the initial unlock screen. As a result, the app needs to return to the start screen if the app crashes for any reason, but Android always returns to the last activity.
It seems like this should be really easy to do, but Android "helpfully" restarts the last activity used, which can't proceed without the client context. Rather than write a bunch of code to detect if the app has restarted after a crash, I'd rather it just returned to the main activity each time. I've looked at the clearTaskOnLaunch and launchMode manifest options, but they don't seem to work after crashes. I have an UncaughtExceptionHandler on every thread, but certain crashes (e.g. in native code) just terminate the app without invoking it.
Yeah, I could bundle the client state up and restore it after a crash, but I don't want to serialize potentially sensitive information, and this seems like something the OS would just support since it sounds so basic.
Ok, now waiting for someone to tell me some incredibly obvious solution that I've missed...
Thanks.