In my app I have a webView, this webView works perfectly in several devices with varieties of OS but it only works in wifi . If I turn off wifi and turn on mobile data, webView doesn't load anything . Here is my code I used for webview .
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
} else {
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAllowContentAccess(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setDatabaseEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setLoadWithOverviewMode(false);
webView.getSettings().setUseWideViewPort(true);
webView.setWebViewClient(new MyWebViewClient());
webView.loadUrl(url);
it may cause of internet problem or link is not valid
try to implement
onReceivedError
to see whether any error occured while load the url