创建对话框内对话框我有一对夫妇一个对话框内对话框被抛出的异常:异常android系统
02-10 15:52:45.592: ERROR/AndroidRuntime(321): java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id 2
的代码是:
dialog.setButton(DialogInterface.BUTTON_POSITIVE, "Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
....
showDialog(ID_DIALOG_SEND);
对话框定义如下:
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case ID_DIALOG_SEND:
ProgressDialog loadingDialog = new ProgressDialog(this);
loadingDialog.setMessage("Sending...");
loadingDialog.setIndeterminate(true);
loadingDialog.setCancelable(false);
return null;
....
而且它不会为这个对话中使用的工作:
Builder b = new AlertDialog.Builder(this);
case ID_DIALOG_ERR:
b.setMessage("Error")
.setCancelable(false)
.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
return null;
任何提示?
感谢