Why would I ever NOT use BitmapFactory's inPurgeable option?

前端 未结 4 1742
臣服心动
臣服心动 2020-12-02 18:48

Android\'s BitmapFactory.Options.inPurgeable has been recommended in various places as a way to avoid OutOfMemory exceptions in Android 2.x and earlier (Android

4条回答
  •  天涯浪人
    2020-12-02 19:31

    For the re-decode to happen, the bitmap must have access to the encoded data, either by sharing a reference to the input or by making a copy of it.

    If you don't have access to the encoded data anymore, then this could be a problem right? What if you were live decoding bitmaps from a streaming ByteArray and your application just decides to reclaim the memory, wouldn't that cause your Bitmap to lose those pixels?

提交回复
热议问题