1

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.

XXX
  • 8,996
  • 7
  • 44
  • 53

1 Answers1

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