How do I hide the cancel button in a custom DialogPreference in Android?
Override onPrepareDialogBuilder and set it to null there.
/** Hide the cancel button */
@Override
protected void onPrepareDialogBuilder(Builder builder) {
super.onPrepareDialogBuilder(builder);
builder.setNegativeButton(null, null);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With