創建對話框內對話框我有一對夫婦一個對話框內對話框被拋出的異常:異常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;
任何提示?
感謝