Contents

조회 수 852 댓글 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


?

  1. [android] AlertDialog 메시지 창 띄우기

    Date2015.07.09 CategoryDevelop Byhooni Views852
    Read More
  2. [android] 코드에서 문자열로 Resource 가져오기

    Date2015.07.09 CategoryDevelop Byhooni Views3948
    Read More
  3. [android] N-Puzzle 게임

    Date2015.07.09 CategoryDevelop Byhooni Views871
    Read More
  4. [ios] WWDC 2015 샘플 소스 코드 통합파일

    Date2015.07.20 CategoryDevelop Byhooni Views665
    Read More
  5. [ios] NSData to NSString (NSString to NSData)

    Date2015.07.21 CategoryDevelop Byhooni Views640
    Read More
  6. [ios] AES256 알고리즘을 이용해 데이터 암호화/복호화 방법

    Date2015.07.21 CategoryDevelop Byhooni Views4107
    Read More
  7. [ios] Objective-C Types & Storage Capacity

    Date2015.07.22 CategoryDevelop Byhooni Views1159
    Read More
  8. [ios] 오브젝티브C→스위프트, 코드 변환 손쉽게

    Date2015.08.07 CategoryDevelop Byhooni Views963
    Read More
  9. [git] 쉬운 버전관리 Git 설명

    Date2015.08.18 CategoryDevelop Byhooni Views878
    Read More
  10. [ios] SBCampanion App 초안

    Date2015.09.16 CategoryDevelop Byhooni Views660
    Read More
  11. [ios] How to set up clang formatter

    Date2015.09.17 CategoryDevelop Byhooni Views1364
    Read More
  12. DDay Memo 1.9.4 소스코드

    Date2015.10.03 CategoryDevelop Byhooni Views0
    Read More
Board Pagination Prev 1 ... 56 57 58 59 60 61 62 63 64 65 ... 71 Next
/ 71