Here is example code how you can use webview client for this i have used gif imageview you can use progressbar instead it.
public class myWebClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
ivGif.setBackgroundResource(R.drawable.anim_set_frames);
AnimationDrawable progressAnimation = (AnimationDrawable) ivGif.getBackground();
progressAnimation.start();
ivGif.setVisibility(View.VISIBLE);
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
ivGif.setVisibility(View.GONE);
}
}
webViewBooking.setWebViewClient(new myWebClient());
webViewBooking.getSettings().setJavaScriptEnabled(true);
webViewBooking.loadUrl(payment_url);