I am trying to find a solution for Application Not Responding (ANR) error when my app is in background. I want any ANR not to occur when my app is not in foreground. How this can be achieved? Thanks in advance.
Asked
Active
Viewed 424 times
-2
-
you have not mentioned what type of activity you are doing in background of app – Bhagyashri Jul 13 '18 at 10:41
1 Answers
3
From Google docs:
Android will display the ANR dialog for a particular application when it detects one of the following conditions:
- No response to an input event (such as key press or screen touch events) within 5 seconds.
- A BroadcastReceiver hasn't finished executing within 10 seconds.
After that be sure to not do blocking/long operations on the UiThread/MainThread even if the App is in background.

emandt
- 2,547
- 2
- 16
- 20