Contents

조회 수 855 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
메세지를 띄우고 [확인] 버튼만 적용할 경우
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


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
1101 Develop [android] ListView+ArrayAdapter 테스트 hooni 2013.04.23 43905
1100 Develop [android] N-Puzzle 게임 file hooni 2015.07.09 875
1099 Develop [android] SQLiteOpenHelper를 이용한 DBManager hooni 2017.06.14 2082
1098 Develop [android] SurfaceView를 이용한 애니메이션 ㅎㅎ file hooni 2013.04.23 57715
1097 PPT [android] XML파서(XMLParser)의 종류와 성능 비교에 대한 발표 자료 file hooni 2013.04.23 75644
1096 Develop [android] [번역] 안드로이드 Android Cloud to Device Messaging(C2DM) hooni 2013.04.23 20426
1095 Develop [android] 가속도 센서를 이용한 흔듦(Shake) 감지 file hooni 2014.11.04 1900
1094 Develop [android] 간단한 SQLIite 예제 hooni 2017.06.14 1339
1093 Develop [android] 개발 환경 세팅 따라하기 ㅋㅋ file hooni 2013.04.23 40407
1092 Develop [android] 단일 Thread 환경의 안드로이드에서 Handler를 사용 file hooni 2013.04.23 26501
1091 Develop [android] 디바이스(시뮬레이터) hosts 파일 수정하기 hooni 2013.04.23 31080
1090 Develop [android] 딜레이를 구현하기 위한 꼼수 hooni 2016.11.24 945
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 ... 98 Next
/ 98