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);
}
}
});