Android 다이얼로그 띄우는 방법입니다.
AlertDialog.Builder builder = new AlertDialog.Builder(test.this);
builder.setTitle("message") // title
.setMessage("nicknameText is null") // message
.setCancelable(false)
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton){
//확인버튼 클릭
}
})
.setNegativeButton("cancel", new DialogInterface.OnClickListener(){
// 취소 버튼 클릭
public void onClick(DialogInterface dialog, int whichButton){
dialog.cancel();
}
});
AlertDialog dialog = builder.create(); // 알림창 객체 생성
dialog.show();
반응형
'IT > Android' 카테고리의 다른 글
구글 플레이 마켓에 앱이 삭제 된 경우. 이렇게 해결 하세요. (5) | 2020.02.21 |
---|---|
[안드로이드] Unable to locate adb 에러 해결 (0) | 2019.05.28 |
스크롤뷰 내부 특정뷰로 포커스되는 현상 막기 (0) | 2018.09.04 |
[오류] is not translated in ko (0) | 2017.03.08 |
Jar mismatch! Fix your dependencies 해결방법 (1) | 2014.09.19 |
안드로이드 상단 타이틀바 없애기 (0) | 2014.09.17 |
Android AsyncTask (1) | 2014.09.01 |
Android SharedPreferences (데이터 읽고 쓰기) (0) | 2014.07.08 |