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.
From Google docs:
Android will display the ANR dialog for a particular application when it detects one of the following conditions:
After that be sure to not do blocking/long operations on the UiThread/MainThread even if the App is in background.