Question

I'm new using CordovaWebView and I have the following problem

When I try to load content into CordovaWebView, first it shows an empty white screen for sometime until it loads it's content.

What I want is to show native loading screen until the CordovaWebView finish loading it's content

Can anyone help here ?

Was it helpful?

Solution

You can override the cordovaWebviewClient present in cordova lib and implement "onPageStarted" and "onPageFinished" methods. In pagestart make progress bar visiblity to visible and on page finish make it to gone.

 public void onPageStarted(WebView view, String url, Bitmap favicon) {
      // TODO Auto-generated method stub
      super.onPageStarted(view, url, favicon);

            progressBar.setVisibility(View.GONE);
     }

     public void onPageFinished(WebView view, String url) {
  // TODO Auto-generated method stub
      super.onPageFinished(view, url);

      progressBar.setVisibility(View.GONE);
     }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top