FileDocCategorySizeDatePackage
ProgressBar4.javaAPI DocGoogle Android v1.5 Example2018Sun Nov 11 13:01:04 GMT 2007com.google.android.samples.view

ProgressBar4

public class ProgressBar4 extends android.app.Activity
Demonstrates how to switch between normal and indetermiate progress indicator in the window's title bar.

Fields Summary
private boolean
mToggleIndeterminate
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        requestWindowFeature(Window.FEATURE_PROGRESS);
        setContentView(R.layout.progressbar_4);
        getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
                Window.PROGRESS_VISIBILITY_ON);
        getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 5000);

        Button button = (Button) findViewById(R.id.toggle);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                mToggleIndeterminate = !mToggleIndeterminate;
                if (mToggleIndeterminate) {
                    getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
                            Window.PROGRESS_INDETERMINATE_ON);
                } else {
                    getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
                            Window.PROGRESS_INDETERMINATE_OFF);
                }
            }
        });