Android clear webview thread, free memory, avoid OutOfMemoryError

前端 未结 3 691
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 08:37

I am displaying a fairly large image in a webview so that the pinch-to-zoom functions and other conveniences for viewing are already available.

It displays correctly the

3条回答
  •  深忆病人
    2021-02-14 09:02

    Okay, so the conclusion to this issue was that the String buffer could not be predetermined or properly cleared at these file sizes.

    In this case the image was pulled from a server as a string, manipulated as a string and finally displayed as an image.

    Whether displayed as an ImageView or as a Webview, it did not matter, the app would crash once a string buffer became full (which it would not clear no matter how much stuff I freed or set to null), This was an encryption effort.

    but Finally just settled with storing the images in the app's assets folder.

提交回复
热议问题