In my WebView, a particular url is not . Apart from this url, all urls are working. Please tell me what's the problem.
webView = findViewById(R.id.web_game);
webView.setWebViewClient(new WebViewClient());
webView.setWebChromeClient(new WebChromeClient());
webView.clearCache(true);
webView.clearHistory();
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.loadUrl("https://cobra-game.conversionlab.online/");
答案 0 :(得分:0)
Add a listener to ignore the SSL errors as given below, You must be receiving some SSL errors while loading the URL.
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Log.d("Failure Url :" , failingUrl);
}
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
Log.d("Ssl Error:",handler.toString() + "error:" + error);
handler.proceed();
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
And add this as well
webView.getSettings().setDomStorageEnabled(true);