TL DR
To accept the code in the implementation of the implementation of the standard exception handler in com.android.internal.os.RuntimeInit.UncaughtHandler , omitting that shows the dialog.
Drilldown
At first, it is clear that System.exit() and Process.killProcess() are required in a scenario where the application crashes (at least in the way that people on Google think).
It is important to note that com.android.internal.os.RuntimeInit.UncaughtHandler can (and can) change between releases of the framework, and also some code in it is not available for your own implementation.
If you are not interested in the default crash dialog and just want to add something to the default handler, you must migrate the default handler. (see below for example)
Our default Uncaught exception handler (sans dialog)
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable ex) { try {
})
Default Handler Wrap
final Thread.UncaughtExceptionHandler defHandler = Thread.getDefaultUncaughtExceptionHandler(); Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable ex) { try {
source share