Search code examples
android-image

webview images are not loading in lollipop versions when i give target sdk version has 21 in manifest file


I am developing an android Web view App. Its working fine when I set target S D K version is below 21,but if I set version as 21 Web view image tags (images) are not loading in lollipop devices.

I searched for the answer but I didn't find any where.Please help me to fix this problem. its working fine for all other previous versions


Solution

  • You need to allow mixed content since default behaviour changed in API21 as described here:

    https://developer.android.com/reference/android/webkit/WebSettings.html#setMixedContentMode(int)

    webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);