Webview Progressbar on reloading a url

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Webview Progressbar on reloading a url

Postby araja » Mon Feb 15, 2010 4:27 pm

Hello,

I have a button and a webview. I am loading a URL in webview on button click. I want to show a progressbar every time user clicks that button and hide progressbar when webview finishes the page loading.

I have written following code for that:

public void onPageStarted(WebView view, String url, Bitmap favicon) {
ProgressBar.setVisibility(View.VISIBLE);
}

public void onPageFinished(WebView view, String url) {
ProgressBar.setVisibility(View.GONE);
}

It works fine for the first time. But when I click the same button again, the progressbar does not come visible. I tried to debug it, and found out that the onPageStarted only called if the current webview URL and the URL to be called are not same. How can I fix it?


Thanks
araja
Developer
Developer
 
Posts: 27
Joined: Wed Nov 04, 2009 9:03 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 6 guests