I looked and looked for a good way to catch unhandled exceptions in my android app that I wrote using Xamarin for Visual Studio. I am not interested in sending them to a webserver at this time, I just want to catch them and log them. I came across this post and became discouraged,
http://mono-for-android.1047100.n5.nabble.com/Catch-all-the-exceptions-td5165993.html
However, this is a solution I came up with to capture unhandled exceptions using Xamarin Android and C# that works for me so I thought I would share it.
Implementing the application class allowed for a global unhandled exception catcher.
The full source is available at
https://github.com/Xandroid4Net/MyExamples/tree/master/UnhandledExceptionExample
Looks good, but I just created an ActivityBase and did my exception handling in it's OnCreate.
ReplyDeleteGreat job.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI am able to display a Toast Message when App is getting crashed. But I am not able to display a alert window.
ReplyDelete