Displaying a dialog on unhandled exception-Collection of common programming errors

I want to be able to display a dialog when my Xamarin Android application crashes. Something like ‘Sorry application has crashed. Would you like to send an error report to the developer?”.

I’ve hooked into Thread.DefaultUncaughtExceptionHandler which calls UncaughtException when an exception is caught.

When the exception is caught I try to start a new activity to display the dialog – the dialog is created but only a blank dialog with the title is shown. OnCreate is never called and the dialog seems to just hang.

If I call the code to display the dialog just normally when the application is running it displays and runs correctly so it doesn’t seem to be anything wrong with the dialog code.

Anyone know how to solve this problem?

Originally posted 2013-11-26 18:02:43.