Issue
Before starting use https my application it worked with http request. Everything is worked fine. But when I decided to change all url to https I have one unsolved problem. I can't show images in webview it doesn't show nothing. What should I do here to show images using https request.
Solution
Loading https url shows blank page because you should decide if your app wants to proceed to an untrusted web site via a WebView. You can set this by overriding onReceivedSslError method in WebViewClient. I tested your image and it shows proper image.
webView.setWebViewClient(new CustomWebViewClient());
...
private class CustomViewClient extends WebViewClient
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
handler.proceed();
}
}
However, this only works from Android 2.2(Froyo). For Android version below 2.2, a public API is not provided.
Answered By - sam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.