How about using setCancelable? Did you try it?
From the Docs:
Control whether the shown Dialog is cancelable. Use this instead of
directly calling Dialog.setCancelable(boolean), because DialogFragment
needs to change its behavior based on this
For custom DialogFragment
Add isCancelable = false at onCreateDialog