android webView loading finished but it was a blank only I touch the screen can the content show Idont know why?and how it happened
- by Sunday
when my webView load this page , it was blank-page or white page only I touch the screen the content can only show
private WebView webview;
private ProgressDialog mProgressDialog;
private Context mContext;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web);
mContext = this;
webview = (WebView)findViewById(R.id.myWebView);
String url = (String)getIntent().getExtras().get("url");
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(new MyWebViewClient());
if(url!=null){
webview.loadUrl(url);
}
}
class MyWebViewClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
mProgressDialog = ProgressDialog.show(mContext, "tips", "wate···the view is loading", true, false);
}
@Override
public void onPageFinished(WebView view, String url) {
mProgressDialog.dismiss();
super.onPageFinished(view, url);
}
}