Summary of causes of Android ANR occurrence

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.