Contents

조회 수 978 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
1089 System/OS 무료로 HTTPS 적용하기 (Let's Encrypt) file hooni 2017.10.28 1658
1088 Etc How to completely Uninstall Coda hooni 2017.10.24 2450
1087 Etc 영어. 불규칙 동사 정리 file hooni 2017.10.04 3627
1086 System/OS [linux] iptables 초간단 세팅 스크립트 hooni 2017.09.26 1383
1085 Develop [ios] VIN Scanner (VIN barcode) 스캐너 file hooni 2017.09.16 763
1084 System/OS [mac] Homebrew/rvm/cocoapod setting hooni 2017.07.29 1155
1083 Etc 캘리포니아 운전면허 문제 file hooni 2017.07.22 1154
1082 Develop [android] 안드로이드 앱 문서 샘플 file hooni 2017.07.11 2206
1081 Develop [coding] 공부해야 하는거 ㅋㅋ secret hooni 2017.06.27 0
1080 Develop [coding] Find all anagrams in a string hooni 2017.06.27 1270
1079 Etc IT감사 기법 시험 file hooni 2017.06.14 1579
1078 Develop [android] SQLiteOpenHelper를 이용한 DBManager hooni 2017.06.14 2160
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 ... 98 Next
/ 98