I\'m new with android.
Currently I want to show an AlertDialog
box with \'OK\' & \'Cancel\' buttons.
The default is PositiveButton: Left, Ne
AlertDialog.Builder builder = new AlertDialog.Builder(SUtils.getContext());
builder.setMessage("Confirmation?")
.setCancelable(false)
.setNegativeButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//TOdo
}
})
.setPositiveButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//TOdo
dialog.cancel();
}
})
diaglog = builder.create();
But I recommend to go along with the convention unless you have a good reason to change the order. That will make easier for users to use your application.