ANR Crash during application debugging

In fact, I created the application and its work is excellent. But suppose I am debugging an application and somehow debugging my device. Now that I have unlocked my device, it crashes and displays ANR (Activity Not Responding). I look at the logarithm, but I can not understand. So please help me solve this. My logarithm is 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 
+4
source share
1 answer

obviously something is blocked UI thread. follow these steps to diagnose if ur code is causing the problem.

  • Create a new project using Activity do nothing.
  • start a new project with debugging.
  • lock the screen and unlock it
  • check for failures

If yes. therefore, the problem should be in the OS and other applications. reset on the phone to factory, if there is no important data on the phone and try again.

if not. The problem is ur code definition. look at code such as β€œOnResume” or β€œOnStart” to find a deadlock or network lock, and therefore not.

-1
source

Source: https://habr.com/ru/post/1401750/


All Articles