CrashReportHandler

Quickly share your Android Code Snippets here...

CrashReportHandler

Postby Dmitry.Skiba » Wed May 27, 2009 7:42 am

Solution for the dreaded 'Force close' dialog.
When exception occurs in main thread, new activity is started with exception's stacktrace. You can add 'Send' button to your liking.
See test project in attachment.

Device owners: please test and report :)
Attachments
crash.png
crash.png (12.52 KiB) Viewed 1123 times
oops.png
oops.png (28.51 KiB) Viewed 1123 times
CrashReportTest.zip
(9.53 KiB) Downloaded 280 times
Dmitry.Skiba
Developer
Developer
 
Posts: 33
Joined: Thu Aug 28, 2008 12:52 pm

Top

Postby SlumberMachine » Mon Jun 08, 2009 10:48 pm

This is excellent! Can this be set as a service so it will detect all "force close" situations or does it only work with the application it's placed in?
SlumberMachine
Developer
Developer
 
Posts: 39
Joined: Tue Feb 24, 2009 9:00 pm

Postby Dmitry.Skiba » Tue Jun 09, 2009 4:32 am

SlumberMachine wrote:This is excellent! Can this be set as a service so it will detect all "force close" situations or does it only work with the application it's placed in?


Yes, it only works for application that called CrashHandler.attach() on its threads.
About "force close" service: I think the only possibility is to periodically analyze logcat for crashes. Though I don't know whether it can be done. Also there is that 'Exception viewer' program in DevTools, which also can give pointers.
Dmitry.Skiba
Developer
Developer
 
Posts: 33
Joined: Thu Aug 28, 2008 12:52 pm

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 8 guests