ANR or Application Not Responding is an android error that happens when the UI thread becomes unresponsive to the user. When the application becomes unresponsive, the user is presented with an ANR dialog that gives them the option to force quit the application.
If your application does not respond to user input or
BroadcastReceiver within five seconds.
BroadcastReceiver has not finished executing within a considerable amount of time, and the application has no ongoing foreground task.
A foreground task is a task noticeable by the user. An example of an ongoing foreground task is a music application playing audio. These tasks display a notification to the user.
BroadcastReceiveris a component that listens to system-wide broadcasts such as a broadcast announcing that the screen was turned off.
Generally, ANRs are triggered because your application is doing the following:
StrictMode you can find accidental I/O operations.
Read more about
StrictModein the official documentation.
Not all ANRs are visible to the user; therefore, the application may be facing performance issues without the user realizing. Enable background ANR dialogs in developer options.
Trace files are generated in an ANR event. You can pull these files using Android Debug Bridge (adb) as root by using the following commands:
adb root adb shell ls /data/anr adb pull /data/anr/<filename>
View all Courses