Android overlay to grab ALL touch, and pass them on?

Found this documentation that pretty much states that it’s not possible to do both:
Android : Multi touch and TYPE_SYSTEM_OVERLAY

They discuss workarounds but I don’t think any of them will actually work for exactly what I’m trying to do. Both given the events to the underlying app, and being able to snoop them to act upon them for myself.

To create an overlay view, when setting up the LayoutParams you need
to set the type to TYPE_SYSTEM_OVERLAY and use the flag
FLAG_WATCH_OUTSIDE_TOUCH. This presents a problem because as the
Android documentation states: “you will not receive the full
down/move/up gesture, only the location of the first down as an
ACTION_OUTSIDE.” In order to receive the full array of touch events
you need to use the TYPE_SYSTEM_ALERT type, but this causes the
overlay to take over the screen and stop interaction with other
elements.

Anyone wants to disagree I’d love to hear good news 😀

Leave a Comment