Issue
I have one legacy application for the emails. The issue is Image content not loading properly post support to android 13 on web view for Android 10 and above, it works well below android 10.
This is how the content is loaded:
webView.loadDataWithBaseURL("file:///android_asset/", html, mMime, mEncoding, null);
assests folder consists .js and .css files with some icons files (.png) as shown in SS.
And this is how the html content is processed
The following settings to web view are already set but it's not working:
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_NORMAL);
webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setAllowFileAccessFromFileURLs(true);
webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
I have already tried as per the official documentation but no luck!
Solution
This issue is resolved. Changes according to the below piece of code work well with the Image loading and as desired.
webView.loadDataWithBaseURL("https://yourdomain.com/", html, mMime, mEncoding, null);
Answered By - Gaurav Karia
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.