【发布时间】:2012-12-10 21:57:40
【问题描述】:
我有一个 fragmentActivity,它使用 startActivityForResult(intent, getCode) 来调用通过 ftp 发送一些文件的活动。
在方法onActivityResult(int requestCode, int resultCode, Intent data)中使用对话框。
对话框是这样调用的:
Bundle bundle = new Bundle();
bundle.putString(LLAVE_TITULO, alertTitulo);
bundle.putString(LLAVE_MENSAJE, alertMensaje);
showDialog(DIALOG_RESPUESTA, bundle);
onCreateDialog 方法是基本的
@Override
protected Dialog onCreateDialog(int id, Bundle bundle)
{
Builder mAlertDialog = new AlertDialog.Builder(this);
mAlertDialog.setTitle(bundle.getString(LLAVE_TITULO));
mAlertDialog.setMessage(bundle.getString(LLAVE_MENSAJE));
mAlertDialog.setPositiveButton("Aceptar",null);
return mAlertDialog.create();
}
一切正常,但我注意到当我非常快地显示和关闭对话框时(我可以更快,每秒一次或两次),在某些时候对话框不再显示,直到我关闭活动并启动它又...
这里发生了什么?我怎样才能真正确定对话框会显示?
谢谢!
【问题讨论】: