posted by 열정개발자 2010/02/17 01:28
안드로이드 알럿 다이얼로그 사용법

1. 알럿 다이어로그 생성
AlertDialog.Builder alert = new AlertDialog.Builder(this);

2. 타이틀 설정
alert.setTitle( "안녕" );

3. 메세지 입력
alert.setMessage( "안녕 난 케이라고해" );

4. 버튼이 눌렀을 때 이벤트 등록
alert.setPositiveButton( "닫기", new DialogInterface.OnClickListener() {
    public void onClick( DialogInterface dialog, int which) {
        dialog.dismiss();   //닫기
    }
});

5. 알럿 다이어로그 호출
alert.show();

6. 결과물

'Android' 카테고리의 다른 글

Android Alert Dialog  (1) 2010/02/17
Android Button Click Event  (0) 2010/02/17
안드로이드 개발 준비 완료!  (0) 2010/02/09