我需要的是显示信息但什么也不做。我试过用“break”和“return true/false”。有什么建议吗?我的代码是:
builder.setPositiveButton("OK", new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
if(chosenCat.size() < 2){
Toast.makeText(getApplicationContext(), "Min 2 categories to compare.", Toast.LENGTH_SHORT).show();
//...needs to abort OK button like nothing pressed
} else {
//...do some stuff
}
}
});