if (dialogFragment != null
&& dialogFragment.getDialog() != null
&& dialogFragment.getDialog().isShowing()
&& !dialogFragment.isRemoving()) {
//dialog is showing so do something
} else {
//dialog is not showing
}
UPDATE: team can you also try the below call, i think it will work logically:
dialogFragment.isResumed
that should mean its in the foreground displaying if im not mistaken.