如果答案正确或错误,我想在我的对话框中显示..但是当我运行我的应用程序时,即使答案是正确的,对话框也将始终显示错误的条件。希望您能够帮助我。这是我的代码
AlertDialog.Builder bb= new AlertDialog.Builder(Circles.this);
Boolean b=(holdV==result);
if(b){
bb.setMessage("Correct");
bb.setPositiveButton("Again",new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
Circles.this.finish();
}
});
}
else{
bb.setMessage("Wrong");
bb.setPositiveButton("Try again!", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
Circles.this.finish();
}
});
AlertDialog alert=bb.create();
alert.show();
}