我有一个运行良好的应用程序,我不知道现在发生了什么我得到这个日志..我是Android的新手,我很难抓住..它在哪里发生错误..你能告诉我这个日志的东西吗? ?谢谢
04-24 04:09:29.561: WARN/ActivityManager(61): Force finishing activity com.gaming.game/.GameActivity
04-24 04:47:55.491: ERROR/ActivityManager(61): ANR in com.gaming.game (com.gaming.game/.GameActivity)
04-24 04:47:55.491: ERROR/ActivityManager(61): Reason: keyDispatchingTimedOut
04-24 04:47:55.491: ERROR/ActivityManager(61): Parent: com.gaming.game/.gaming
04-24 04:47:55.491: ERROR/ActivityManager(61): Load: 0.86 / 0.54 / 0.41
04-24 04:47:55.491: ERROR/ActivityManager(61): CPU usage from 48945ms to 2842ms ago:
04-24 04:47:55.491: ERROR/ActivityManager(61): 9.2% 61/system_server: 6.9% user + 2.2% kernel / faults: 1381 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 1.2% 672/com.android.launcher: 0.6% user + 0.6% kernel / faults: 368 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0.6% 448/com.android.defcontainer: 0.1% user + 0.5% kernel / faults: 56 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 1% 41/adbd: 0.1% user + 0.9% kernel / faults: 64 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0.3% 125/com.android.systemui: 0.2% user + 0% kernel / faults: 1 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0.2% 123/com.android.phone: 0% user + 0.1% kernel / faults: 2 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 587/logcat: 0% user + 0% kernel
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 35/installd: 0% user + 0% kernel / faults: 6 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 120/jp.co.omronsoft.openwnn: 0% user + 0% kernel / faults: 3 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 313/com.android.quicksearchbox: 0% user + 0% kernel / faults: 2 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 4/events/0: 0% user + 0% kernel
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 32/rild: 0% user + 0% kernel
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 33/zygote: 0% user + 0% kernel / faults: 18 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 0% 499/com.svox.pico: 0% user + 0% kernel / faults: 18 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): +0% 1565/com.gaming.game: 0% user + 0% kernel
04-24 04:47:55.491: ERROR/ActivityManager(61): 31% TOTAL: 19% user + 11% kernel + 0% irq + 0.2% softirq
04-24 04:47:55.491: ERROR/ActivityManager(61): CPU usage from 796ms to 1401ms later:
04-24 04:47:55.491: ERROR/ActivityManager(61): 43% 1565/com.gaming.game: 0% user + 43% kernel / faults: 1 minor
04-24 04:47:55.491: ERROR/ActivityManager(61): 43% 1567/HeapWorker: 0% user + 43% kernel
04-24 04:47:55.491: ERROR/ActivityManager(61): 10% 61/system_server: 6.6% user + 3.3% kernel
04-24 04:47:55.491: ERROR/ActivityManager(61): 10% 100/InputDispatcher: 6.6% user + 3.3% kernel
04-24 04:47:55.491: ERROR/ActivityManager(61): 76% TOTAL: 4.6% user + 72% kernel
答案 0 :(得分:1)
ANR表示您的应用程序没有响应。即你正在做一个昂贵的操作(没有你的代码我们无法分辨)锁定UI线程。尝试启动一些AsyncTasks或使用服务进行长时间运行。
答案 1 :(得分:1)
错误/ ActivityManager(61):com.gaming.game中的ANR(com.gaming.game/.GameActivity) 原因:keyDispatchingTimedOut 04-24 04:47:55.491:
你的活动花了很长时间才能被杀死。
看一下这篇文章:http://danbarnett.net/android-anr-keydispatchingtimedout-178.html
此ANR或应用程序不是 响应,错误发生时 主线程上的进程也需要 很长(类似于5秒)。 Android会杀死该进程和任何进程 设计相关,以备不时之需 设备的资源。
解决方案是运行 另一个资源昂贵的任务 线程,然后发布,或更新 相应的主线程。常见的用途 这是网络电话(和这个 是我的问题)。该 以下是如何进行的示例 在我的情况下实现这个逻辑 检查是否需要更新:
答案 2 :(得分:0)
尝试在将位图设置到画布之后以及在其上添加其他内容之前添加一些休眠时间。它帮助了我