ANR(Application is Not Responding) is a dialog box that appears when the application is not responding. This ANR dialogue is displayed whenever the main thread within an application has been unresponsive for a long time under the following conditions:
When there is no response to an input event even after 5 seconds.
When a broadcast receiver has not completed its execution within 10 seconds.
Following measures can be taken to avoid ANR:
An application should perform lengthy database or networking operations in separate threads to avoid ANR.
For background task-intensive applications, you can lessen pressure from the UI thread by using the IntentService.