Develop
2015.07.09 10:04
[android] AlertDialog 메시지 창 띄우기
조회 수 859 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
1113 | Develop | [php] 쉘에서 실행할 때 인수(파라미터) 받기.. | hooni | 2003.04.23 | 11599 |
1112 | Develop | [js] 자바스크립트로 응용프로그램 실행 ㅎㅎ | hooni | 2003.04.23 | 9815 |
1111 | Develop | [php] URL/URI 관련 환경변수 | hooni | 2003.04.23 | 9164 |
1110 | Develop | [js] 쿠키(cookie)에 대한 설명과 예제.. | hooni | 2003.04.23 | 8325 |
1109 | Develop | [js] 스크롤을 포함한 마우스 위치 찾는 코드 | hooni | 2003.04.23 | 8508 |
1108 | Develop | [c] pcap을 이용한 패킷 분석 ㅎㅎ | hooni | 2003.04.23 | 10212 |
1107 | Develop | [linux] 쉘 스크립트를 이용한 BBS | hooni | 2003.04.23 | 10049 |
1106 | Develop | [unix] 쉘 스크립트 예제 모음 | hooni | 2003.04.23 | 14951 |
1105 | System/OS | [linux] vi 편집기 간단한 명령과 환경설정 | hooni | 2003.04.23 | 11362 |
1104 | System/OS | [linux] 리눅스 활용 팁^^ | hooni | 2003.04.23 | 14633 |
1103 | System/OS | [linux] 기본 명령어 (내공쌓기) | hooni | 2003.04.23 | 14335 |
1102 | System/OS | [linux] 간단한 vi편집기 사용 명령 | hooni | 2003.04.23 | 13460 |