android dialog
아래 Sample은 각각 종류별로 정리했다. 종류는 아래와 같다.
- Basic Alert - 아주 기본적인 Alert Dialog
 - Button add - Dialog 창에 Button이 추가
 - List type - 여러가지 항목을 선택
 - CheckBox type - CheckBox가 포함
 - RadioButton type - RadioButton이 포함(미리 체크 항목을 선택 할 수 있음)
 - ProgressDialog type - 동그란 에니메이션이 동작함
 - ProgressBar type - 막대 형태로 진행 상태를 표시함
 - Custom Dialog - 임의 디자인을 적용
 
1. Basic Alert

 AlertDialog.Builder ab = null; 
  | 
2. Button add

 AlertDialog.Builder builder = new AlertDialog.Builder(this); 
  | 
3. List type

 final CharSequence[] items = {"Red", "Green", "Blue"}; 
  | 
4. RadioButtons type

 final CharSequence[] items = {"Red", "Green", "Blue"}; 
  | 
5. Checkboxes type

 final CharSequence[] items = {"Red", "Green", "Blue"}; 
  | 
6. ProgressDialog type

 private class ProgressDialogStop extends Thread 
  | 
 ProgressDialog dialog = ProgressDialog.show(AlertDialogTest.this, "",   | 
7. ProgressBar type

 private class ProgressBarStop extends Thread 
  | 
 ProgressDialog progressDialog = null; 
  | 
8. CustomDialog type

 별도 Dialog 타입 Layout을 설정해야 한다. 
 <?xml version="1.0" encoding="utf-8"?> 
  | 
 import android.app.Dialog; 
 
  | 
 Dialog dialog = new MyCustomDialog(this);  | 
9. CustomDialog type 2
위 8번 내용을 그대로 사용.

 
 
 AlertDialog.Builder md = new AlertDialog.Builder(this); 
  | 
적절히 사용하면 좋을 듯 하다.
'scrap > Android' 카테고리의 다른 글
| android web server (0) | 2011.02.14 | 
|---|---|
| DialogInterface 생성하기 (0) | 2011.02.06 | 
| [Android] Activity 에서 Dialog 띄우기. (0) | 2011.02.06 | 
| AlertDialog (0) | 2011.02.06 | 
| ListView, ListAdapter (0) | 2011.02.04 |