出于某种原因,当单击AlertDialog上的肯定按钮时,对话框将关闭,但处理程序中没有任何已定义的方法被执行。
目前,这只发生在运行Android 6.0的Huawei-ALE-L21上。对于所有其他设备,按钮点击已注册,应用程序就像一个魅力。
以下是代码:
private void showDialog() {
mInterface.getAlertDialog(getString(R.string.for_your_safety), getString(R.string.for_your_safety_text), true)
.setPositiveButton(R.string.allright, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) { //method implementation
}
})
.setNeutralButton(R.string.read, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) { //method implementation
}
})
.create()
.show();
}
任何想法或解决方案?