I need to display a website in a WebView. I went through almost all possible solution but my WebView doesn't display the site correctly. Following is my code:
progDailog = ProgressDialog.show(this, "Loading","Please wait...", true);
progDailog.setCancelable(false);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
progDailog.show();
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, final String url) {
progDailog.dismiss();
}
});
webView.loadUrl("https://www.site.ru/login");
If I copy the URL 'https://www.site.ru/login' in a mobile browser it displays correctly but in Android app when I tried to load same URL in WebView, but it shows progressBar then everything is displayed white and blank in WebView Screen.
UPD: my xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/sign_up_web_view"
android:layout_width="match_parent"
android:layout_height="match_parent"></WebView>
</RelativeLayout>