【发布时间】:2012-02-18 17:18:21
【问题描述】:
我正在尝试在另一个AlertDialog 中打开一个AlertDialog,但它不起作用,知道为什么它不起作用吗?
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时是否收到任何错误消息?
标签: android dialog android-alertdialog