[ProgressBar4.java]
public class ProgressBar4 extends Activity {
private boolean mToggleIndeterminate = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Request progress bar
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.progressbar_4);
setProgressBarIndeterminateVisibility(mToggleIndeterminate);
Button button = (Button) findViewById(R.id.toggle);
button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
mToggleIndeterminate = !mToggleIndeterminate;
setProgressBarIndeterminateVisibility(mToggleIndeterminate);
}
});
}
}
[progressbar_4.xml]
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button android:id="@+id/toggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/progressbar_4_toggle" />
</LinearLayout>
'old > API_Demo' 카테고리의 다른 글
Views_RatingBar (0) | 2010.05.06 |
---|---|
Views_RadioGroup (0) | 2010.05.06 |
Views_ProgressBar_Dialogs (0) | 2010.05.06 |
Views_ProgressBar_Smooth (0) | 2010.05.06 |
Views_ProgressBar_Incremental (0) | 2010.05.06 |