ProgressDialog _dialog ; // Global Variable WebView webView = (WebView)findViewById(R.id.webview); webView.setWebViewClient(new WebViewClient(){ @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { _dialog =ProgressDialog.show(CurrentActivity.this, "", "Please wait..."); super.onPageStarted(view, url, favicon); } // end OnPageStarted @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); _dialog.dismiss(); } // end OnPageFinished() @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { super.onReceivedError(view, errorCode, description, failingUrl); try{ _dialog.dismiss(); }catch (Exception e) { // TODO: handle exception } } // end onReceivedError() }); // end WebViewclient
When onPageStarted is called ,start the dialog and finish in onPageFinished , onRecievedError() methods.
explication not enough
ReplyDeleteI have an issue with the Bitmap
I'm unable to get what you are asking.Do u mean bitmap in OnpageStarted()?
ReplyDelete