Develop
2015.07.09 10:04
[android] AlertDialog 메시지 창 띄우기
조회 수 855 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
241 | Develop | [jsp] 페이지에 한글이 정상적으로 보이지 않을 때.. | hooni | 2013.04.23 | 8165 |
240 | Develop | [jsp][php] LDAP 프로그래밍.. | hooni | 2003.04.23 | 7386 |
239 | Develop | [jsp][php] 간단한 강좌 자료.. | hooni | 2003.04.23 | 8112 |
238 | Develop | [js] 2048 예쁘게 만들고 있는거.. ㅋㄷ | hooni | 2015.01.30 | 0 |
237 | Develop | [js] 2차 잉여.. (Quadratic reciprocity) 계산.. | hooni | 2013.04.23 | 7077 |
236 | Develop | [js] ajax를 이용해 외부문서 불러오기.. | hooni | 2013.04.23 | 6801 |
235 | Develop | [js] AngularJS 란? | hooni | 2015.11.26 | 899 |
234 | Develop | [js] AngularJS를 소개합니다. | hooni | 2014.01.06 | 13017 |
233 | Develop | [js] Array.splice() 설명 | hooni | 2014.04.24 | 3009 |
232 | Develop | [js] Click button copy to clipboard | hooni | 2018.04.05 | 1181 |
231 | Develop | [js] Closure를 이용해 캡슐화.. | hooni | 2013.12.16 | 9596 |
230 | Develop | [js] e.stopPropagation() VS e.preventDefault () | hooni | 2015.04.14 | 814 |