Views 849 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
메세지를 띄우고 [확인] 버튼만 적용할 경우
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
No. Category Subject Author Date Views
917 System/OS [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 hooni 2014.12.18 993
916 System/OS [svn] SVN trunk 변경사항 되돌리기 (SVN Rollback) hooni 2014.11.27 1564
915 Develop [ios] 비동기 블럭 코드 예제 hooni 2014.11.21 825
914 Develop [ios] 스크린 캡쳐 (전원버튼 + 홈버튼) 호출 알아내기 hooni 2014.11.19 1556
913 Develop [android] 가속도 센서를 이용한 흔듦(Shake) 감지 file hooni 2014.11.04 1898
912 Develop [web] 더 빠른 웹을 위한 프로토콜, 'HTTP/2' file hooni 2014.10.20 1641
911 Develop GPL, AGPL, MPL,.. 한눈에 보는 오픈소스SW 라이선스 file hooni 2014.10.14 1146
910 Develop [js] 좋은 강연자료 & UI 자료 hooni 2014.10.06 905
909 Develop '2014 모바일 개발 트렌드' 발표자료입니다. file hooni 2014.10.02 976
908 Develop [ios] iOS 8 개발자가 우선 알아야 할 3가지 file hooni 2014.10.02 898
907 Develop [js] jQuery 셀 병합 1 file hooni 2014.09.23 3488
906 Etc IoT가 만드는 미래와 플랫폼 경쟁력 secret hooni 2014.09.23 0
905 System/OS SVN(Subversion) 설치와 설정 (sasl 인증 적용 포함) file hooni 2014.09.11 5664
904 System/OS [linux] yum 업데이트 시 커널 제외하기 hooni 2014.09.11 1256
903 Develop [ios] Xcode cannot run using the selected device hooni 2014.08.14 1785
902 Develop [ios] Objective-C 에서 자주 사용하는 수학 함수와 유용한 Define hooni 2014.08.08 1856
Board Pagination Prev 1 ... 15 16 17 18 19 ... 74 Next
/ 74