super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.progressbar_1);
getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
Window.PROGRESS_VISIBILITY_ON);
getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 5000);
final ProgressBar progress = (ProgressBar) findViewById(R.id.progress_big);
final ProgressBar progressSmall = (ProgressBar) findViewById(R.id.progress_small);
Button button = (Button) findViewById(R.id.increase);
button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
progress.incrementProgressBy(1);
progressSmall.incrementProgressBy(1);
// window's progress is in range 0..10000
getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
10000 * progressSmall.getProgress() / 100);
}
});
button = (Button) findViewById(R.id.decrease);
button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
progress.incrementProgressBy(-1);
progressSmall.incrementProgressBy(-1);
// window's progress is in range 0..10000
getWindow().setFeatureInt(Window.FEATURE_PROGRESS,
10000 * progressSmall.getProgress() / 100);
}
});