gpt4 book ai didi

android - 为什么我永远不会使用 BitmapFactory 的 inPurgeable 选项?

转载 作者:IT老高 更新时间:2023-10-28 22:22:38 26 4
gpt4 key购买 nike

Android 的 BitmapFactory.Options.inPurgeable 已在 various places 中被推荐作为在 Android 2.x 及更早版本 (Android 3.1 fixes this ) 中避免 OutOfMemory 异常的一种方式。

如果 inPurgeable 如此出色,我为什么不想使用它? documentation关于这个选项的作用的细节似乎很清楚:

If this is set to true, then the resulting bitmap will allocate its pixels such that they can be purged if the system needs to reclaim memory. In that instance, when the pixels need to be accessed again (e.g. the bitmap is drawn, getPixels() is called), they will be automatically re-decoded

看起来不错。有什么收获?

最佳答案

documentation随后更新了解决您原始问题的其他信息。

总结:不再推荐使用此标志。

关于android - 为什么我永远不会使用 BitmapFactory 的 inPurgeable 选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7068132/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com