Tarun Tak
Tarun Tak

Reputation: 421

android: how to handle force close

In my application when the memory is low, the force close popup occurs. What I want is to handle that force close pop up in my application. How can I do this?

Upvotes: 3

Views: 3723

Answers (3)

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: 4

Eric Nordvik
Eric Nordvik

Reputation: 14746

You cannot control this popup from your own application. This is controlled by the Android OS. It is better to analyze what is causing your FCs.

If your error is caused by memory issues, you could try implementing the onLowMemory-function in your Activity. This is a callback function that will be called once the system detects it needs more memory.

Upvotes: 2

softcharles
softcharles

Reputation: 102

The best you can to is to avoid getting there. You most probably have a memory leak, but if you really need to work close to the memory limit, the best thing you can do is to catch the OutOfMemoryError you get.

Upvotes: 0

Related Questions