【问题标题】:Right Track with Log Message带有日志消息的正确轨道
【发布时间】:2013-06-03 12:44:31
【问题描述】:

我只是想知道我是否走在正确的轨道上。好吧,我习惯了Netbeans 用于java,但由于Eclipse 最适合android,我决定使用Eclipse。每当我在 Eclipse 上运行我的应用程序并检查日志消息时,我发现了很多警告,尽管它在模拟器和设备上都运行良好。但我希望这与以后应用程序的有效性无关。有时我的Eclipse 会出现一些不必要的错误(代码中没有错误),这些错误会在关闭并重新启动时自行纠正(这是一个错误,我使用的是最新的Eclipse)。我会很感激你的cmets。

以下是一些日志消息:

06-03 12:41:04.603: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.613: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.683: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.713: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.713: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.884: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.906: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.906: W/Trace(3934): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.953: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:04.973: I/Choreographer(3395): Skipped 88 frames!  The application may be doing too much work on its main thread.
06-03 12:41:05.133: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.133: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.143: I/Choreographer(3395): Skipped 33 frames!  The application may be doing too much work on its main thread.
06-03 12:41:05.553: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.594: I/Choreographer(3395): Skipped 612 frames!  The application may be doing too much work on its main thread.
06-03 12:41:05.633: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.633: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.763: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.793: W/Trace(3395): Unexpected value from nativeGetEnabledTags: 0
06-03 12:41:05.793: W/SoundPool(3395):   sample 0 not READY
06-03 12:41:05.854: D/PhoneStatusBar(3934): disable: < expand icons alerts ticker system_info BACK HOME recent* CLOCK search >
06-03 12:41:05.883: W/Trace(3511): Unexpected value from nativeGetEnabledTags: 0

LogCat收到的警告消息的顺序我很想知道它是否正常。因为说真的,我在主线程上没有做太多工作。并且任何带有数据库查询的 Activity 都在 Thread thread = new Thread(Runable); thread.start()。我需要澄清一下,因为我在空活动中收到同样的警告消息事件(我的意思是没有工作的活动)。请我在这里需要认真的帮助,因为我不想做错事,以为我在写东西

【问题讨论】:

标签: android eclipse logging


【解决方案1】:

此警告告诉您,您在 UI 线程上做了太多工作。那是主线。这肯定会导致电池电量不足、电源不足或硬件不佳的设备出现问题。您应该优化您的代码并在单独的线程中执行繁重的任务。您应该为此考虑 AsyncTask - android 中可用于多线程的类。

【讨论】:

  • 因此,长时间看到警告是一种享受。但是有没有可能完全消除它。
猜你喜欢
  • 2015-01-06
  • 2011-10-24
  • 2013-08-20
  • 2013-08-31
  • 1970-01-01
  • 2021-07-27
  • 2017-12-10
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多