How To Put A Progress Bar In An Application Using Tabs
I have a main java file that sets up a series of tabs where each one calls a seperate activity in this case each activity is linked to a webpage. I am trying to implemente a progre
Solution 1:
Hey this is exactly what I do in my webviews
In the onCreate method of the webview[in your case it may be your tabActivity] do this
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.webview_simple);
}
then in the webview client do this
privateclassMyWebViewClientextendsWebViewClient {
public synchronized booleanshouldOverrideUrlLoading(WebView view, String url){
}// and all ur implementationpublicvoidonPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
setProgressBarIndeterminateVisibility(false);
}
publicvoidonPageStarted(WebView view, String url, Bitmap favicon) {
setProgressBarIndeterminateVisibility(true);
super.onPageStarted(view, url, favicon);
}
}
Hope it helps. I am overriding the onPageFinished and onPageStarted in the webview client. Its difficult to do it from onProgressChanged. I tried it but I found this to be simple.
Post a Comment for "How To Put A Progress Bar In An Application Using Tabs"