Why I want to do this is another discussion entirely, but I need to figure out the best way to make all my alert dialogs have the positive button on the right side. Note that i
You can extend the AlertDialog.Builder
to force the order:
public class MyDialog extends AlertDialog.Builder {
public MyDialog(Context arg0) {
super(arg0);
}
@Override
public Builder setPositiveButton(CharSequence text, OnClickListener listener) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return super.setNegativeButton(text, listener);
} else {
return super.setPositiveButton(text, listener);
}
}
@Override
public Builder setNegativeButton(CharSequence text, OnClickListener listener) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
return super.setPositiveButton(text, listener);
} else {
return super.setNegativeButton(text, listener);
}
}
}