Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Usual way to stop and log an unrecoverable error

What is the usual way on Android to stop my application if it has reached an unrecoverable error.

finish() will not do it, since it wont stop any running services or threads. Furthermore I would like to inform the user what has happend and please him to send an error log.

As far as I googled, it seems like there is no way to close my application and open a special crashreport activity or something else to show the user whats going on or send a crash log.

like image 767
Chris Avatar asked Oct 05 '22 05:10

Chris


1 Answers

I think you should throw unhandled runtime exception. In such case android will kill all your process. Also I suggest you to use ACRA. This library will help you to get crash report (via email, google docs, etс.) and it can show customizable error dialog to a user.

like image 179
Leonidos Avatar answered Oct 10 '22 11:10

Leonidos