Android Drawable vs Asset in Image loading performance

我是研究僧i 提交于 2019-12-05 14:28:26

If you are passing an asset Uri to something like an ImageView, the framework will use BitmapFactory to stream a downsampled version of the image from disk. This is the technique it uses under the hood.

Drawables do not use this technique, for performance reasons. It is not generally expected that huge images are stored as Drawables, and Drawable loading happens many times over your app's lifecycle, so they are streamed from disk in their entirety and cached in memory.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!