Is there any way to catch crashes in my own android app? Something like a global uncaught exception handler? Just wondering if I could install something like that, then if an uncaught exception is thrown, I could pop up a dialog for the user and ask if they want to mail a dump of the exception to me.
Thanks
Interface for handlers invoked when a Thread abruptly terminates due to an uncaught exception. When a thread is about to terminate due to an uncaught exception the Java Virtual Machine will query the thread for its UncaughtExceptionHandler using Thread.
There are a number of things you need to do: Handle uncaughtException in your Application subclass. After catching an exception, start a new activity to ask the user to send a log. Extract the log info from logcat's files and write to your own file.
The global error handler is used catch all errors and remove the need for duplicated error handling code throughout the . NET api. It's configured as middleware in the configure HTTP request pipeline section of the Program.
Editorial Staff. June 01, 2022. CWE 248-Uncaught Exception occurs when an exception is not caught by a programming construct or by the programmer, it results in an uncaught exception. In Java, for example, this would be an unhandled exception that would terminate the program.
Is there any way to catch crashes in my own android app? Something like a global uncaught exception handler?
See Thread.setDefaultUncaughtExceptionHandler()
.
Just wondering if I could install something like that, then if an uncaught exception is thrown, I could pop up a dialog for the user and ask if they want to mail a dump of the exception to me.
You can also use Flurry, DroidDrop, or any of the other implementations of this already available.
Bugsense.com also does this (for free)
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