我是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. 

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


当前回答

因为我首先最好使用SVG图像而不是所有其他类型的图像,如果不可能,使用一些图像处理工具(如Adobe Photoshop或Fotosizer)压缩所有PNG和JPG资源。最简单的方法之一是在线图像压缩工具,像这样,它帮助我把所有的图像文件减少到初始大小的50%。

其他回答

这其实不是问题。当调试器运行了很长时间时,就会发生这种情况。取下制动点并再次检查。

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.

我的应用程序也有同样的问题。但除了显示卡片列表和文本之外,它并没有做其他事情。没有在后台运行。但随后经过一些调查发现,卡片背景的图像设置导致了这种情况,尽管它很小(350kb)。然后我将图像转换为9patch图像使用 http://romannurik.github.io/AndroidAssetStudio/index.html。 这对我很管用。

优化你的图片…不要使用大于100KB的图片…图像加载占用太多CPU,导致你的应用程序挂起。