我在屏幕上显示了DIALOG_start_NFC
提醒对话框,我希望在方法MethodName
中关闭它并显示对话框DIALOG_Process_CertificateGeneration
,并在每个提醒对话框DIALOG_Process_CertificateGeneration
上更改消息一步。
但是方法MethodNam Desplaymsg()
已执行,但DIALOG_start_NFC
不会被解雇。我无法得到对话DIALOG_Process_CertificateGeneration
protected Dialog onCreateDialog(int id, Bundle args) {
switch (id) {
case DIALOG_start_NFC :
// A dialog that we show when we are ready to write to a tag:
return new AlertDialog.Builder(this)
.setTitle("title")
.setMessage("msg ")
.setCancelable(true)
.setNeutralButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int arg) {
d.cancel();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface d) {
bstartnfc = false;
}
}).create();
case DIALOG_Process_CertificateGeneration:
return new AlertDialog.Builder(this)
.setTitle("title")
.setMessage(args.getString("msg"))
.setCancelable(false)
.setPositiveButton("confirm ",new
DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
}).create();
}
}
我将它用于此方法:
private void MethodName()
{
Desplaymag("method2");
method2();
Desplaymag( "method3");
method3();
}
private void DisplayMsg(String msg)
{
Bundle arg= new Bundle();
arg.putString("msg"," step: " + msg);
CertificateGenerationActivity.this.showDialog(DIALOG_Process_CertificateGeneration,arg);
}
我希望在执行method2
之前和Methode2
之前收到消息Method3
。但是在执行method2
和method3
后的代码中,我的消息已更改