我想在另一個AlertDialog
中打開一個AlertDialog
,但它不工作,爲什麼它不工作的任何想法?AlertDialog.Builder打開另一個AlertDialog.Builder
String items[] = {"Details","Edit","Delete"}
AlertDialog.Builder alert = new AlertDialog.Builder(getAplicationContext());
alert.setTitle("Options");
alert.setItems(items, new OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
switch(item){
case 0:
AlertDialog.Builder alert2 = new AlertDialog.Builder(getAplicationContext());
alert2.setTitle("Details");
alert2.setMessage(getDetails());
alert2.setNeutralButton("Close", null);
alert2.show();
return;
case 1:
//not important for the question
return;
case 2:
//not important for the question
return;
}
}
});
alert.setNegativeButton("Cancel", null);
alert.show();
定義「不工作」。嘗試在另一個AlertDialog中打開AlertDialog時是否收到任何錯誤消息?謝謝你, – Rob 2012-02-18 17:24:22