4

当我开始我的活动时,我收到一个 ANR 错误。我不知道如何修复,我认为这个错误是由于事件。

这是错误:

    01-23 12:29:29.594: E/ActivityManager(147): ANR in com.vxoom.qit.login (com.vxoom.qit.login/.UpdateTokenList)
01-23 12:29:29.594: E/ActivityManager(147): Reason: keyDispatchingTimedOut
01-23 12:29:29.594: E/ActivityManager(147): Load: 2.36 / 2.14 / 2.09
01-23 12:29:29.594: E/ActivityManager(147): CPU usage from 24818ms to 0ms ago with 99% awake:
01-23 12:29:29.594: E/ActivityManager(147):   3.3% 3575/com.vxoom.qit.login: 2.9% user + 0.3% kernel / faults: 939 minor
01-23 12:29:29.594: E/ActivityManager(147):   2% 3/ksoftirqd/0: 0% user + 2% kernel
01-23 12:29:29.594: E/ActivityManager(147):   0.6% 477/RTKTHREAD: 0% user + 0.6% kernel
01-23 12:29:29.594: E/ActivityManager(147):   0.3% 214/com.android.systemui: 0.2% user + 0% kernel / faults: 10 minor
01-23 12:29:29.594: E/ActivityManager(147):   0.2% 147/system_server: 0.2% user + 0% kernel / faults: 23 minor
01-23 12:29:29.594: E/ActivityManager(147):   0.1% 85/surfaceflinger: 0% user + 0% kernel
01-23 12:29:29.594: E/ActivityManager(147):   0% 133/adbd: 0% user + 0% kernel
01-23 12:29:29.594: E/ActivityManager(147):   0% 2611/kworker/u:0: 0% user + 0% kernel
01-23 12:29:29.594: E/ActivityManager(147):   0% 3450/kworker/u:1: 0% user + 0% kernel
01-23 12:29:29.594: E/ActivityManager(147): 7.4% TOTAL: 3.5% user + 3.5% kernel + 0.2% softirq
01-23 12:29:29.594: E/ActivityManager(147): CPU usage from 354ms to 868ms later:
01-23 12:29:29.594: E/ActivityManager(147):   2.7% 477/RTKTHREAD: 0% user + 2.7% kernel
01-23 12:29:29.594: E/ActivityManager(147):   1.2% 3/ksoftirqd/0: 0% user + 1.2% kernel
01-23 12:29:29.594: E/ActivityManager(147):   1.9% 147/system_server: 0% user + 1.9% kernel
01-23 12:29:29.594: E/ActivityManager(147):     1.9% 179/InputDispatcher: 0% user + 1.9% kernel
01-23 12:29:29.594: E/ActivityManager(147): 7.6% TOTAL: 0% user + 7.6% kernel
4

1 回答 1

0

不,这很可能是你的错。由于 UI 线程中正在执行某些操作,因此无法调度触摸事件。这就是引发异常的原因。

在手机设置中打开开发者选项并启用严格模式(可能命名不同),它将帮助您在主线程中找到长时间运行的操作。

触发 ANR 的原因:http:
//developer.android.com/training/articles/perf-anr.html

于 2013-01-23T07:50:07.723 回答