For example, my application throws a NullPointerException
. How to open the Activity (for example – SendCrashLogActivity
, or finished Activity1
)?
My scenario:
You can reproduce this scenario using small demo application
If it is impossible then application should not be restarted.
Thread.setDefaultUncaughtExceptionHandler (new Thread.UncaughtExceptionHandler()
{
@Override
public void uncaughtException (Thread thread, Throwable e)
{
Intent intent = new Intent (getApplicationContext(),DrawView.class);
startActivity(intent); //after calling this method, my application will be frozen. Android 6
}
});