-2

my app is getting "force close" randomly. And every time error can not be same. Is there a way to pop up "error message" with that "force close" to determine what is the cause of it. How to I handle "force close" properly?

Appreciate your help.

user1143989
  • 163
  • 1
  • 3
  • 18

2 Answers2

0

The way you handle "force close" is to -- whenever you get one -- get a logcat dump of your app and find out what went wrong. This is a bug in your app, you must fix it before distributing your app. Use the logcat to get the error that caused your app to crash: you're probably doing something bad in the design of your app if you're getting them in different places.. (I.e., work on the UI thread.) You can also look into ACRA if you want to get them after deployment.

Kristopher Micinski
  • 7,572
  • 3
  • 29
  • 34
  • Yes, my app is deployed and some users are complaining about force close. I do not have access to those tablet to use logcat. – user1143989 Mar 21 '12 at 13:29
  • This is why you should use ACRA in your apps. It will give you logcat dumps so you can (at least) know why your app is crashing to some extent. If you don't have it already, there's no way to know now, except to have *them* do a logcat dump.. – Kristopher Micinski Mar 21 '12 at 13:30
  • Thanks for replying. So using ACRA, I can see users logcat dump ? – user1143989 Mar 21 '12 at 13:33
  • You can, but you have to put it on your app before distributing it. It's a library that goes with your app. Now that your app is deployed the best thing to do is to: -- ask the users what they were doing when it crashed (although they'll probably not tell you) -- release an updated version with ACRA and hope it will give you good logs. – Kristopher Micinski Mar 21 '12 at 13:34
  • Thanks a bunch. You answered all my questions. Now I will start working on that!! – user1143989 Mar 21 '12 at 13:36
-1

For that you have to use

 Thread.setDefaultUncaughtExceptionHandler

Please look at the following link to get more info:

How do I obtain crash-data from my Android application?

Community
  • 1
  • 1
Sadeshkumar Periyasamy
  • 4,848
  • 1
  • 26
  • 31