gpt4 book ai didi

连续点击屏幕时Android ANR keyDispatchingTimedOut错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:40:10 33 4
gpt4 key购买 nike

我在连续点击屏幕时收到应用程序无响应 (ANR) 对话框。我正在点击的屏幕上没有 View 。这个问题出现的频率较低,但我仍然无法完全消除它。

我在这里附上我在这个错误中捕获的日志。

ERROR/ActivityManager(1322): ANR in com.test.mj.and.ui     (com.test.mj.and.ui/.TermsAndCondActivity)
ERROR/ActivityManager(1322): Reason: keyDispatchingTimedOut
ERROR/ActivityManager(1322): Parent: com.test.mj.and.ui/.SplashActivity
ERROR/ActivityManager(1322): Load: 6.59 / 6.37 / 5.21
ERROR/ActivityManager(1322): CPU usage from 11430ms to 2196ms ago:
ERROR/ActivityManager(1322): rtal.mj.and.ui: 9% = 7% user + 1% kernel / faults: 649 minor
ERROR/ActivityManager(1322): system_server: 4% = 2% user + 2% kernel / faults: 10 minor
ERROR/ActivityManager(1322): logcat: 3% = 1% user + 1% kernel / faults: 675 minor 1 major
ERROR/ActivityManager(1322): synaptics_wq: 1% = 0% user + 1% kernel
ERROR/ActivityManager(1322): ami304d: 1% = 0% user + 0% kernel
ERROR/ActivityManager(1322): .process.lghome: 1% = 0% user + 0% kernel / faults: 47 minor
ERROR/ActivityManager(1322): sync_supers: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322): droid.DunServer: 0% = 0% user + 0% kernel / faults: 6 minor
ERROR/ActivityManager(1322): events/0: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322): oid.inputmethod: 0% = 0% user + 0% kernel / faults: 2 minor
ERROR/ActivityManager(1322): m.android.phone: 0% = 0% user + 0% kernel / faults: 2 minor
ERROR/ActivityManager(1322): ndroid.settings: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322): sh: 0% = 0% user + 0% kernel / faults: 110 minor
ERROR/ActivityManager(1322): -flush-179:0: 0% = 0% user + 0% kernel
ERROR/ActivityManager(1322): TOTAL: 19% = 13% user + 6% kernel
WARN/WindowManager(1322): Continuing to wait for key to be dispatched
WARN/WindowManager(1322): No window to dispatch pointer action 1

谁能帮我解决这个问题?

提前致谢。

最佳答案

它通常发生在 onClick 处理程序中执行一些耗时的 Activity ,例如从网络获取资源或计算一些复杂的东西。为此使用单独的线程(UI 线程),以便 onclick 处理程序可以返回并且窗口管理器将继续。

http://developer.android.com/resources/articles/painless-threading.html

您可以在 View 上使用 Asynctask 或 postDelayed

关于连续点击屏幕时Android ANR keyDispatchingTimedOut错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4529770/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com