Hi, am using the simple code in android to load the Node-Red dashboard in a webview. The dashboard is loading in every other browser except this webview, while the webview is capable of loading other webpage URLs. When i load am getting blank WHITE page. This webview is capable of loading other web pages except nodered dashboard. I have attached my activity code with this, Since this is relativley urgent task, Your quick response would be appreciated .
package com.example.myapplication;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.http.SslError;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
public class WebviewIncogActivity extends AppCompatActivity {
WebView webView;
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview_incog);
String url=getIntent().getStringExtra("router_ip");
url="https://"+url+":1880/ui";
webView=(WebView)findViewById(R.id.webview_incog);
webView.clearCache(true);
webView.clearHistory();
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setAppCacheEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setAllowFileAccess(true);
webView.setWebViewClient(new WebViewClient(){
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
Toast.makeText(getApplicationContext(),"SSl Error",Toast.LENGTH_LONG).show();
handler.proceed();
}
@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
Toast.makeText(getApplicationContext(),"Error",Toast.LENGTH_LONG).show();
}
@Override
public void onPageFinished(WebView view, String url) {
}
});
webView.loadUrl(url);
}
}