Android 应用运行缓慢

Android app runs slowly

我正在 Android 5.0 上开发一个非常简单的应用程序,但它总是滞后。只有一个 textedit 和一个自定义按钮 drawable 而不是普通按钮。 drawable 是一个 2000x2000 的 png 文件。 当我使用 android 设备监视器查看线程时,我注意到 "Render Thread" 一直在占用。我不知道它的确切功能。有人知道我的错误可能在哪里吗?

抱歉没有代码示例,我只是不知道什么会导致我的滞后以及我应该这样做 post。

When you load a bitmap, keep it in RAM only at the resolution you need for the current device's screen, scaling it down if the original bitmap is a higher resolution. Keep in mind that an increase in bitmap resolution results in a corresponding (increase2) in memory needed, because both the X and Y dimensions increase.

所以,我的建议是,请使用 SMALL 图片尺寸而不是 LARGE

使用不同的可绘制对象(使用 asset studio)resolutions.Also 使用 tinypng 工具减小图像的大小。