- Get link
- X
- Other Apps
If your program is busy processing information, you program will appear to drag and users will give up on them since they appear stuck. This is where progress bars come into play. Progress bars let them know your app is working. They can be finite or indefinite and a simple one can be implemented easily since they are built into the Activity class.
Here is an example of setting a progress bar while loading a web page:
Here is an example of setting a progress bar while loading a web page:
requestWindowFeature(Window.FEATURE_PROGRESS);
this.setProgressBarVisibility(true);
final Activity activity = this;
myWebView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
// Activities and WebViews measure progress with different scales.
// The progress meter will automatically disappear when we reach 100%
//activity.setProgress(progress *100);
pbar.setProgress(progress);
}
});
And like everything else, you can get creative and customize your progress bars as a widget or a dialog.- Get link
- X
- Other Apps
Comments
Post a Comment