I have a web view which takes a bit of time to load, so I have a progress indicator which should show until the webView is ready. However, what is the best way to do this? I have:
webView.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
//mListener.finishedLoadingHtml();
ProgressBar bar = (ProgressBar) view.findViewById(R.id.article_content_progressIndicator);
bar.setVisibility(View.GONE);
}
});
but that doesn't work as bar = null. Is there an easy way to get access to the progressBar from within the callback? I am still struggling a bit with the Android view hierarchy etc.
I do it by
javaScript
at start I show
progressBar
on mywebView
and when page load completely I use a javaScript to notify java that should goneprogressBar
by this way:ProgressBar bar = (ProgressBar) view.findViewById(R.id.article_content_progressIndicator);
and inside html page by javaScript call method like this: