重新用AlertDialog.Builder绑定XML都不更新吗?
还有我建议LZ ,最先初始化对话框的时候就做一下判断吧 ,判断用户的输入, 如果太长 , 就直接简化处理
比如对方输入1111111111111111111111 , 判断是否超过了8个字符
超过了你就直接设置为
还有我建议LZ ,最先初始化对话框的时候就做一下判断吧 ,判断用户的输入, 如果太长 , 就直接简化处理
比如对方输入1111111111111111111111 , 判断是否超过了8个字符
超过了你就直接设置为
protected Dialog onCreateDialog(int id) {
AlertDialog dialog = null;
if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
// construct dialog
dialog = new AlertDialog.Builder(this)
.setTitle(getText(R.string.emergency_enable_radio_dialog_title))
.setMessage(createErrorMessage(mLastNumber))
.setPositiveButton(R.string.ok, null)
.setCancelable(true).create();
dialog.getCurrentFocus();
// blur stuff behind the dialog
dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
return dialog;
} @Override
protected void onPrepareDialog(int id, Dialog dialog) {
super.onPrepareDialog(id, dialog);
if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
AlertDialog alert = (AlertDialog) dialog;
alert.setMessage(createErrorMessage(mLastNumber));
}
}
如果你每次重新构造一个Dialog应该就不会出现你的问题吧
AlertDialog alert = (AlertDialog) dialog;
alert.setMessage(createErrorMessage(mLastNumber));
你在这段代码不是一直调用同一个dalog?
楼主当你每次弹出纳格dialog的时候,直接new一个不行嘛?new出来的不就是刷新的了。