Contents

조회 수 992 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
메세지를 띄우고 [확인] 버튼만 적용할 경우
AlertDialog.Builder alert = new AlertDialog.Builder(MyActivity.this);
alert.setPositiveButton("확인", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
    dialog.dismiss();     //닫기
    }
});
alert.setMessage("테스트 메세지");
alert.show();

메세지를 띄우고 [확인], [취소] 버튼으로 적용할 경우
AlertDialog.Builder alert_confirm = new AlertDialog.Builder(MyActivity.this);

alert_confirm.setMessage("Yes or No?").setCancelable(false).setPositiveButton("YES",
new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
        // 'YES'
    }
}).setNegativeButton("NO",
new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
        // 'No'
    return;
    }
});
AlertDialog alert = alert_confirm.create();
alert.show();


[출처] http://shstarkr.tistory.com/144


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
441 Develop [js] 네이버에서 그림 퍼올 때.. URL Encoding 관련ㅋㅋ hooni 2013.04.23 7252
440 Develop [jsp] 초간단한 include 구문 예제.. file hooni 2013.04.23 7246
439 Develop [c] 문자열 라이브러리 최신버전 file hooni 2003.04.23 7223
438 Develop [c] 네트워크 관련 프로그래밍 (포트스캔 탐지 샘플) file hooni 2013.04.23 7221
437 Develop [c] 함수 목록과 예제 소스 파일 file hooni 2013.04.23 7211
436 Develop [c] 시스템 보안 과제.. 시간(amc time) 변경 file hooni 2013.04.23 7207
435 Develop [c++] template 사용예 hooni 2003.04.23 7207
434 Develop [php] 탐색기와 같은 다이나믹 트리(xml/xsl 이용) file hooni 2013.04.23 7206
433 Develop [c] 시스템공학 레포트 (pass1, pass2) file hooni 2003.04.23 7206
432 Develop [c] 가변인자 함수(printf와 같은..) hooni 2013.04.23 7204
431 Develop [c++] 트리컨트롤 예제1 ㅋㅋ file hooni 2013.04.23 7197
430 Develop [c] 연산자 우선순위.. ㅋㅋ hooni 2013.04.23 7196
Board Pagination Prev 1 ... 57 58 59 60 61 62 63 64 65 66 ... 98 Next
/ 98