Android 更改警报对话框上的消息或更好的解决方案
我在屏幕上显示了一个Android 更改警报对话框上的消息或更好的解决方案,android,Android,我在屏幕上显示了一个DIALOG\u start\u NFCalert对话框,我想在methodMethodName中关闭它,并显示DIALOGDIALOG\u Process\u CertificateGeneration和每个步骤的alert DIALOGDIALOG\u Process\u CertificateGeneration上的更改消息。 但是在方法MethodNam desplaymg()中执行,但是对话框\u start\u NFC不会关闭。我无法获得dialogdialog\
DIALOG\u start\u NFC
alert对话框,我想在methodMethodName
中关闭它,并显示DIALOGDIALOG\u Process\u CertificateGeneration
和每个步骤的alert DIALOGDIALOG\u Process\u CertificateGeneration
上的更改消息。但是在方法
MethodNam desplaymg()
中执行,但是对话框\u start\u NFC
不会关闭。我无法获得dialogdialog\u Process\u 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
之前获取消息method2
,也要获取Method3
的消息。但是在执行method2
和method3
之后,我的消息被更改了