Develop
2015.07.09 10:04
[android] AlertDialog 메시지 창 띄우기
조회 수 982 댓글 0
메세지를 띄우고 [확인] 버튼만 적용할 경우
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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
93 | Develop |
[coding] 공부해야 하는거 ㅋㅋ
![]() |
hooni | 2017.06.27 | 0 |
92 | Develop |
[android] 안드로이드 앱 문서 샘플
![]() |
hooni | 2017.07.11 | 2219 |
91 | Etc |
캘리포니아 운전면허 문제
![]() |
hooni | 2017.07.22 | 1174 |
90 | System/OS | [mac] Homebrew/rvm/cocoapod setting | hooni | 2017.07.29 | 1179 |
89 | Develop |
[ios] VIN Scanner (VIN barcode) 스캐너
![]() |
hooni | 2017.09.16 | 785 |
88 | System/OS | [linux] iptables 초간단 세팅 스크립트 | hooni | 2017.09.26 | 1401 |
87 | Etc |
영어. 불규칙 동사 정리
![]() |
hooni | 2017.10.04 | 3656 |
86 | Etc | How to completely Uninstall Coda | hooni | 2017.10.24 | 2544 |
85 | System/OS |
무료로 HTTPS 적용하기 (Let's Encrypt)
![]() |
hooni | 2017.10.28 | 1690 |
84 | System/OS | OpenSSL로 ROOT CA 생성 및 SSL 인증서 발급하기 | hooni | 2017.10.28 | 1639 |
83 | System/OS | [mac] How to uninstall MySQL on Mac OS. | hooni | 2017.11.08 | 1046 |
82 | Database | [mysql] 중복데이터 삭제하는 초간단 쿼리 | hooni | 2017.11.22 | 3557 |