I have this weird ANR keydispatchingtimedout issue after my device goes to sleep and wakes up. Reproducing the bug is kind of difficult since I need 15-20 minutes of sleep to get the ANR. I'm not doing any intensive task in the UI thread. When the device goes to sleep, the app keeps doing some background (threads) work, but nothing else.
Asked
Active
Viewed 348 times
1
-
Maybe related: http://stackoverflow.com/questions/3467205/android-key-dispatching-timed-out and this: http://stackoverflow.com/questions/5513457/anr-keydispatchingtimedout-error – SERPRO Mar 12 '12 at 16:22
-
Is it something in Broadcast receiver ?? – Brijesh Thakur Mar 12 '12 at 16:19
-
No, it is not in Broadcast receiver – Renier Marichal Mar 12 '12 at 22:31
-
Ok, thanks anyway, it was something in the Broadcast receiver. – Renier Marichal Dec 10 '13 at 01:21
1 Answers
1
You mentioned that you do some async tasks. I had this issue when I was running some network tasks, and when the task returned, the device was in sleep (onPaused called).
You might want to handle the task result or cancel the running task in the onPause.
task.cancel(true);

dcanh121
- 4,665
- 11
- 37
- 84