Contents

조회 수 984 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
73 Develop [ppt] iOS 플라랩#04(2015.06.19) 발표 자료 file hooni 2015.06.04 773
72 Develop [python] DJI Tello 드론 코딩 (프로그래밍) 58 file hooni 2018.03.04 27435
71 Develop [python] 애니팡, 캔디팡 매크로 file hooni 2013.09.06 17619
70 Develop [python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs) hooni 2019.11.22 1697
69 Develop [python] 파이썬 공부하는 사이트~ hooni 2013.11.12 10891
68 Develop [python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기) hooni 2019.12.06 1832
67 Develop [sh] html 안에 있는 img 다운 받는 쉘 스크립트 file hooni 2020.05.26 763
66 Develop [sh] 쉘스크립트 if 비교 연산 hooni 2020.05.26 60985
65 Develop [spring] 스프링 IoC/DI hooni 2013.04.23 11409
64 Develop [swift] NotificationCenter 간단 예제 file hooni 2021.01.27 8340
63 Develop [swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기 file hooni 2021.01.29 1598
62 Develop [swift] UIView에서 subview 찾기 hooni 2022.12.09 2059
Board Pagination Prev 1 ... 60 61 62 63 64 65 66 67 68 69 ... 71 Next
/ 71