ANR (Application not responding) application unresponsive in Android system
is a common problem in the Android system, and when ANR occurs, a dialog box prompt with the following text pops up:
Activity XXX (in XXXXX) are not responding. Like what:
There are two situations in which a rough chapter can lead to ANR:
First class: Dispatchtimeout the input event distribution timed out, typically because the main thread did not respond to input events within 5 seconds.
Class II: Broadcastreceiver is not completed and returned within the time set by the system.
Subdivision of the word ANR may be caused by the main thread or it may be caused by a non-main thread:
As a result of the main thread:
1. Time-Consuming network access
2. Request data Read and write when there is a large amount of data read and write operations
3. Database operations (such as other large data volumes when the database is overloaded with database access)
4. Hardware operation (e.g. camera)
5. Call Thread_join ()/Sleep ()/wait () or wait for locker
6.Service Binder quantity up to limit
7. Watchdog ANR occurs in System_server
8.Service busy causing timeout not responding
As a result of non-main thread:
1. The non-main thread holds lock, causing the main thread to wait for the lock timeout
2. Non-main thread termination or crash causes the main thread to wait
From:http://www.cnblogs.com/mobile-veterans/archive/2012/07/20/2600715.html
Summary of causes of Android ANR occurrence