Question about curiosity.
I use many dialog box developers, and most of the time my cancel button cancels nothing but rejecting the dialog. The code I found throughout the Internet is this:
builder.setNegativeButton(
"cancel",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}
);
I happened to find out that this code does the same:
builder.setNegativeButton("cancel", null);
So my question is: is it a bad habit not to manually reject the dialogue, and if so, why?
source
share