I'm new with android.
Currently I want to show an AlertDialog
box with 'OK' & 'Cancel' buttons.
The default is PositiveButton: Left, NegativeButton: Right
Can you let me know how can I move the PositiveButton to the right side & NegativeButton to the left side?
Is there any chance/trouble if Negativebutton cause a bad sound when pressing OK, if We change text "OK" to NegativeButton & "Cancel" to PositiveButton.
My Code:
AlertDialog.Builder builder = new AlertDialog.Builder(SUtils.getContext());
builder.setMessage("Confirmation?")
.setCancelable(false)
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//Todo
dialog.cancel();
}
})
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//TOdo
}
})
dialog = builder.create();
Thanks, Angel
This might not be a direct answer. But just some information on related topic. From this thread in Google's own forum, Romain guy said..
and the convention per OS version is
If it is a convention, that android/Google wants to follow, isn't it better you follow the same, since your users won't be using your app alone. After all user friendliness is the first thing a developer looks for..