How do I hide the cancel button in a custom DialogPreference in Android?
Asked
Active
Viewed 2,467 times
1 Answers
17
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);
}

Thomas Dignan
- 7,052
- 3
- 40
- 48