'How to dispatch touch event from DialogFragment to Activity?
I have a DialogFragment, that shows on top of the MainActivity. When the user touches the dialog fragment I want to detect that motion event in the MainActivity below. Right now I am using this:
dialog?.window?.decorView?.setOnTouchListener {
activity.dispatchTouchEvent()
}
But it doesn't work as I want to. It detects the touches on the white parts of the dialog, but not everywhere. For example I have an imageView in the dialog fragment's xml and if i touch that, the motion event is not detected at all. Is it possible to dispatch the events from every view in the dialog?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
