我是Android SDK/API环境的新手。这是我第一次试着画一个图表。我尝试在模拟器上使用3个不同的免费库运行不同种类的示例代码,没有显示在布局屏幕上。日志猫正在重复如下信息:

 W/Trace(1378): Unexpected value from nativeGetEnabledTags: 0
 I/Choreographer(1378): Skipped 55 frames!  The application may be doing too much work on its main thread. 

当我运行一个与授权库的评估副本相关的示例代码时,这个问题并没有持续存在,图表也正常工作。


当前回答

this usually happens when you are executing huge processes in main thread. it's OK to skip frames less than 200. but if you have more than 200 skipped frames, it can slow down your application UI thread. what you can do is to do these processes in a new thread called worker thread and after that, when you want to access and do something with UI thread(ex: do something with views, findView etc...) you can use handler or runOnUiThread(I like this more) in order to display the processing results. this absolutely solves the problem. using worker threads are very useful or even must be used when it comes to this cases.

https://stacklearn.ir

其他回答

还没有解决,但会解决的。对于我的小项目,有一个可组合的功能(按钮)和逻辑来检查是否“com. com”。在启动模拟器时,我在相同的日志中有以下内容:

I/Choreographer: Skipped 34 frames!  The application may be doing too much work on its main thread.

尝试使用以下策略来提高应用程序的性能:

尽可能使用多线程编程。即使你的智能手机只有一个核(如果处理器有两个或更多核,线程可以在不同的核上运行),性能上的好处也是巨大的。让你的应用逻辑与UI分离是很有用的。使用Java线程,AsyncTask或IntentService。检查这个。 阅读并遵循Android开发网站的各种性能提示。检查在这里。

在这个问题上做了很多研究之后,我得到了解决方案,

在我的情况下,我使用的服务将运行每2秒和runonUIThread,我想知道问题是在那里,但根本没有。 我发现的下一个问题是我在五月的应用程序中使用大图像,这就是问题所在。

我删除了图像,并设置了新的图像。

结论:-检查你的代码是否有任何你正在使用的原始文件是大的。

正如上面其他人回答的那样,“跳过55帧!”意味着应用程序中有一些繁重的处理。

对于我的情况,我的申请过程并不繁琐。我反复检查了所有内容,并删除了那些我认为有点沉重的过程。

我删除了片段、活动、库,直到只剩下骨架。但是问题仍然没有消失。我决定检查一下资源,发现我使用的一些图标和背景相当大,因为我忘记检查这些资源的大小。

因此,我的建议是,如果以上答案都没有帮助,您也可以检查您的资源文件大小。

如果在应用程序中使用async/await功能,这是正常的。