나는 데이터베이스에 되돌릴 수없는 일을하기 전에 사용자에게 확인을 두 번 요청하려고합니다. 문제는 외부 클릭 핸들러가 내부 클릭 핸들러를 기다리지 않는다는 것입니다. 첫 번째 대화 상자에서 예 버튼을 클릭하면 두 번째 대화 상자가 잠시 표시되지만 바깥 쪽 핸들러가 실행되고 완료 되더라도 궁극적으로 두 대화 상자 모두가 손상됩니다.Android 중첩 AlertDialog - 이것이 가능합니까?
new AlertDialog.Builder(ActivityMain.this).setMessage(
"Are you sure?").setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
new AlertDialog.Builder(ActivityMain.this).setMessage(
"Are you really sure?").setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
....
왜 그렇습니까?
아직 시도하지는 않았지만 마음에 들었습니다. – cdonner