Try below code -
put this code in onCreate()
Method
webView.setWebViewClient(new myWebClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("Your web url");
public class myWebClient extends WebViewClient
{
private ProgressDialog myProgressDialog;
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
myProgressDialog = new ProgressDialog(YourActivity.this);
myProgressDialog.setCancelable(false);
myProgressDialog.show();
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
super.onPageFinished(view, url);
try{
if (myProgressDialog != null)
myProgressDialog.dismiss();
}
catch(Exception e)
{
e.printStackTrace();
}
}
@Override
public void doUpdateVisitedHistory(WebView view, String url,
boolean isReload) {
// TODO Auto-generated method stub
super.doUpdateVisitedHistory(view, url, isReload);
}
@Override
public void onLoadResource(WebView view, String url) {
// TODO Auto-generated method stub
super.onLoadResource(view, url);
}
}
Hope this code helps you!!!!
If it is not working please let me know i will try to help you more..