I am implementing webview application in android. When i am trying to load https url one or two times it finishes the activity. Agian tryin
Add this overriding method to your WebViewClient implementation. You'll need to compile it with Android SDK 2.2 (API level 8) or later. The method appears in the public SDK as of 2.2 (API level 8) but we've tested it on devices running 2.1, 1.6 and 1.5 and it works on those devices too (so obviously the behaviour has been there all along).
WebView.setWebViewClient(new WebViewClient() {
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error){
handler.proceed();
}
});
Delete this string:
super.onReceivedSslError(view, handler, error);
and in this method
public boolean shouldOverrideUrlLoading(WebView view, String url) {
turn return to false
like this:
return false;
It helped me
One possibility here is a race condition.
You are loading https://www.facebook.com/ before setting up the WebViewClient, so there is a possibility that your implementation of OnReceivedSslError() will never get called if you get a quick enough response from facebook.
This would explain why it works for some people, not for others, and always works if the page is reloaded.
Also, I think you should just be returning false from shouldOverrideUrlLoading() if you want the page to load rather than attempting to reload the page - this might cause an infinite recursion / crash - possibly depending upon timing.