我在我的 android 应用程序中重用了一个 AlertDialog 框。
我在 onCreateDialog() 方法和 onPrepareDialog() 方法中创建了一个对话框,我尝试使用以下代码更改 positiveButton 的文本。
alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, this.getString(R.string.add), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//Handler code
}
}
onclick 侦听器正在更改,但按钮文本未更改。
这是Android中的错误还是我做错了什么?