Droidand
Droidand

Reputation: 176

Android Force Close

In my application, whenever I got some crash it shows Force Close the application. If i click force its automatically restarting the application from the page it got crashed and it shows some malfunctioned activities, Invalid Data and No record... Can you anyone please help to handle this force close, probably like when ever the user clicks that force close it should completely kill the application and the user can relaunch himself to avoid that corrupted data cuz of the crash.

Upvotes: 2

Views: 5538

Answers (3)

tellie
tellie

Reputation: 11

Force closes in Android can have many different reasons. It's hard to know the reason for your specific problem since we don't get a lot of information. One problem could be that your data partition is full or almost full. Checkout this guide: Android force close solution

Hope it helps.

Upvotes: 1

Piyush Patel
Piyush Patel

Reputation: 1825

You can completely control/handle ForceClose Dialog ! so it doesn't show up to user.

Use ACRA - Application Crash Report for Android to collect Crash generated by app. Once you integrate it with your app, if any crash occurs user won't see FORCE CLOSE dialog, instead you can show your CUSTOM ERROR message.

It turns out to be better user experience. let me know if you need more info. Good luck :)

Upvotes: 0

anon
anon

Reputation:

The only thing you can do if you don't want to properly handle the error that causes the force close is to register a global uncaught exception handler. This allows you to catch all Exceptions that you don't have caught anywhere else. Maybe this helps you to recover from such situations. At least you could implement there a log function or something similar.

However I would recommend to try to fix the error in the first place in your code.

Upvotes: 2

Related Questions