9

I have created an app and it works fine. But sometimes when I debug my app the device locks. Then when I unlock device it crashes and shows the ANR (Activity Not Responding). I look at the logcat but not able to get any clue from there. So please help me to solve this out. My logcat is given below:

03-16 16:54:46.117: E/ActivityManager(114): ANR in in.plackal.lovecyclesfree
03-16 16:54:46.117: E/ActivityManager(114): Reason: Broadcast of Intent {    act=android.intent.action.SCREEN_OFF flg=0x40000000 }
03-16 16:54:46.117: E/ActivityManager(114): Load: 1.49 / 1.23 / 1.28
03-16 16:54:46.117: E/ActivityManager(114): CPU usage from 5083ms to 0ms ago:
03-16 16:54:46.117: E/ActivityManager(114):   2.5% 114/system_server: 1.5% user + 0.9% kernel / faults: 3 minor
03-16 16:54:46.117: E/ActivityManager(114):   0% 14/kondemand/0: 0% user + 0% kernel
03-16 16:54:46.117: E/ActivityManager(114):   0% 49/file-storage: 0% user + 0% kernel
03-16 16:54:46.117: E/ActivityManager(114):   0.1% 182/com.android.systemui: 0.1% user + 0% kernel
03-16 16:54:46.117: E/ActivityManager(114): 2.9% TOTAL: 2.1% user + 0.7% kernel
03-16 16:54:46.117: E/ActivityManager(114): CPU usage from 212ms to 723ms later:
03-16 16:54:46.117: E/ActivityManager(114):   7.2% 114/system_server: 1.8% user + 5.4% kernel
03-16 16:54:46.117: E/ActivityManager(114):     7.2% 130/ActivityManager: 1.8% user + 5.4% kernel
03-16 16:54:46.117: E/ActivityManager(114):     1.8% 121/SurfaceFlinger: 1.8% user + 0% kernel
03-16 16:54:46.117: E/ActivityManager(114):   1.4% 182/com.android.systemui: 1.4% user + 0% kernel
03-16 16:54:46.117: E/ActivityManager(114): 3.8% TOTAL: 1.9% user + 1.9% kernel
iknow
  • 8,358
  • 12
  • 41
  • 68
AndroidDev
  • 4,521
  • 24
  • 78
  • 126

1 Answers1

-3

apparently something locked UI thread. do follow for diagnose if it's ur code cause the problem.

  1. create new project with a Activity do nothing.
  2. launch new project with debugging.
  3. lock screen and unlock it
  4. see if crash still happen

if yes. so the problem should be in os and other application. reset phone to factory setting if no important data on the phone and try again.

if no. the problem is locate in ur code. review code like 'OnResume' or 'OnStart' to find deadlock loop or network blocking and so no.

luotasha
  • 33
  • 2
  • Yeh the error is in my code only..Actually in my code onStart() method i read all the data that are stored using file, and by using this data i update mu UI. But if i comment that code and again start debugging then also the crash occur, and this crash occur only when app is debugging not when it is running. – AndroidDev Mar 16 '12 at 07:45