Develop/안드로이드 (Android)

[Android] Confirm Message 띄우기

안다희 2019. 3. 10. 02:31
728x90
new AlertDialog.Builder(this)
.setTitle("로그아웃")
.setMessage("로그아웃 하시겠습니까?")
.setIcon(R.drawable.ic_people)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// 확인시 처리 로직
showShortToastMsg("로그아웃되었습니다.");
getLocalStore().clearTokenValues();
startActivity(intent5);
}})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// 취소시 처리 로직
showShortToastMsg("취소하였습니다.");
}})
.show();