0

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

以下是一些日志消息:

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(). 请我澄清一下,因为我在空活动中收到同样的警告消息事件(我的意思是没有工作的活动)。请我在这里需要认真的帮助,因为我不想做错事,以为我在写东西

4

1 回答 1

0

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

于 2013-06-03T13:13:00.347 回答