I need to intercept all touch events in the application to monitor for a custom activity time out.
Currently I use dispatchTouchEvent()
in my activities but this is not called if I have a dialog on the screen. Does any one know if there any way I can have this same functionality with a dialog being present?
Thanks
For use
dispatchTouchEvent()
in DialogFragment, overrideonCreateDialog
and return a customDialog
withdispatchTouchEvent
(in your custom DialogFragment).Exemple, for dismiss keyboard when click outside in DialogFragment: