I want to hide buttons from my AlertDialog. I found this solution but it simply disables the buttons.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
...
AlertDialog dialog = builder.create();
Button button = dialog.getButton(Dialog.BUTTON_POSITIVE);
button.setEnabled(false);
return dialog;
}