반응형
Confirm 메시지 사용하기
AlertDialog 클래스를 사용하여 Confrim메시지를 처리할 수 있습니다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
new AlertDialog.Builder( this )
.setTitle( "캐릭터 삭제" )
.setMessage( "[" + strCharNm + "] 캐럭터를 삭제하시겠습니까?" )
.setIcon( R.drawable.ic_launcher_background )
.setPositiveButton("예", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// "예"를 선택했을 때의 Action
}
})
.setNegativeButton("아니오", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// "아니오"를 선택했을 때의 Action
}
})
.show();
|
cs |
The End.
반응형
'Study > Android Studio' 카테고리의 다른 글
[Android] Gravity 속성의 이해 (0) | 2021.02.24 |
---|---|
[Android] TextView 기본 속성 (0) | 2021.02.18 |
[Android] Tips.쿼리 문자열로 관리하기 (0) | 2021.02.18 |
[Android] Toast 메시지 설정 (0) | 2021.02.18 |
[Android] 키보드 입력언어 Default 설정하기 (0) | 2021.02.17 |