Develop
2015.07.09 10:04
[android] AlertDialog 메시지 창 띄우기
조회 수 971 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
69 | System/OS | [linux] vi 편집기 간단한 명령과 환경설정 | hooni | 2003.04.23 | 11402 |
68 | Develop | [unix] 쉘 스크립트 예제 모음 | hooni | 2003.04.23 | 14992 |
67 | Develop | [linux] 쉘 스크립트를 이용한 BBS | hooni | 2003.04.23 | 10070 |
66 | Develop | [c] pcap을 이용한 패킷 분석 ㅎㅎ | hooni | 2003.04.23 | 10231 |
65 | Develop | [js] 스크롤을 포함한 마우스 위치 찾는 코드 | hooni | 2003.04.23 | 8539 |
64 | Develop | [js] 쿠키(cookie)에 대한 설명과 예제.. | hooni | 2003.04.23 | 8342 |
63 | Develop | [php] URL/URI 관련 환경변수 | hooni | 2003.04.23 | 9198 |
62 | Develop | [js] 자바스크립트로 응용프로그램 실행 ㅎㅎ | hooni | 2003.04.23 | 9837 |
61 | Develop | [php] 쉘에서 실행할 때 인수(파라미터) 받기.. | hooni | 2003.04.23 | 11636 |
60 | Develop | [js] 자바스크립트 이벤트 핸들.. | hooni | 2003.04.23 | 7933 |
59 | Develop | [css] 화면 스크롤 제어 ㅋㅋ | hooni | 2003.04.23 | 8698 |
58 | Develop | [php] 배열 관련 함수 설명 ㅎㅎ | hooni | 2003.04.23 | 11772 |