I am working in an android application and am using a DialogFragment to show a dialog and I want to make that DialogFragment not cancelable. I have made the dialog cancelabl
Use the following Snippet
void showDialog() {
DialogFragment newFragment = MyAlertDialogFragment.newInstance(
R.string..alert_dialog_two_buttons_title);
newFragment.setCancelable(false);
newFragment.show(getFragmentManager(), "dialog");
}
and if you want to disable the out side touch around dialog use the following line of code
DialogFragment.getDialog().setCanceledOnTouchOutside(true);