Issue
I have a problem with WebView on Android 11 (this worked under Android 10). The html
<img src='file:///storage/emulated/0/Android/data/<package>/image_cache/item_15.bmp'>
does not load the image. That html is part of a larger string. The image file was created by the same app and is valid.
What's changed?
Solution
Try setting webview.getSettings().setAllowFileAccess(true);
. The documentation says:
The default value is true for apps targeting Build.VERSION_CODES.Q and below, and false when targeting Build.VERSION_CODES.R and above.
Answered By - rakesh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.