Develop
2015.07.09 10:04
[android] AlertDialog 메시지 창 띄우기
조회 수 978 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
1089 | System/OS |
네트워크 용어 정리
![]() |
hooni | 2022.11.20 | 1550 |
1088 | PPT |
네오웹 세미나 자료~
![]() |
hooni | 2013.05.28 | 0 |
1087 | System/OS | 나중에 해봐야지.. libconv 설치.. ㅡ,.ㅡ; | hooni | 2013.04.23 | 19325 |
1086 | Develop |
객체지향 프로그래밍에 대한 개념.. (객체)
![]() |
hooni | 2013.04.23 | 7335 |
1085 | System/OS | 개인적으로 쓰고 있는 zshrc 파일 | hooni | 2022.02.25 | 985 |
1084 | System/OS | 개인적으로 쓰고 있는 bash_profile | hooni | 2015.01.16 | 964 |
1083 | Etc | 개발자가 알아야할 10가지 보안팁으로 코드 보호하기 | hooni | 2013.04.23 | 16442 |
1082 | System/OS |
[펌] 마이크로서비스, 모노리포, SRE, ... 덮어놓고 구글 따라하면 안 되는 기술들
![]() |
hooni | 2020.10.15 | 1086 |
1081 | Develop | [펌] 게임 엔진 만든거 공개합니다. | hooni | 2015.02.21 | 2451 |
1080 | Develop |
[자료구조] 트리(tree) 용어정리
![]() |
hooni | 2003.04.23 | 11095 |
1079 | Etc | [용어] POC, Pilot, BMT에 대한 IT 업계에서 통용되는 의미 | hooni | 2014.01.02 | 42030 |
1078 | Etc | [세미나] XML 레포트.. | hooni | 2003.04.23 | 19763 |