I\'m new with android.
Currently I want to show an AlertDialog
box with \'OK\' & \'Cancel\' buttons.
The default is PositiveButton: Left, Ne
check this https://github.com/hslls/order-alert-buttons
dependencies {
compile 'com.github.hslls:order-alert-buttons:1.0.0'
}
AlertDialogParams params = new AlertDialogParams();
params.mTitle = "title";
params.mMessage = "message";
params.mPositiveText = "Ok";
params.mNegativeText = "Cancel";
params.mCancelable = true;
params.mAlign = BUTTON_ALIGN.POSITIVE_BUTTON_LEFT; // fix button position
params.mClickListener = new AlertDialogClickListener() {
@Override
public void onPositiveClicked() {
}
@Override
public void onNegativeClicked() {
}
};
AlertDialog dialog = AlertDialogBuilder.createAlertDialog(this, params);