Search code examples
androidontouchlistener

Passing clicks events from floating app to covered app


I have a floating app which works perfectly.

I am using OnTouchListener to catch events since I need to use the GestureDetector for swipes etc. My only problem is that sometimes I wish to ignore certain events on the view. In this case the view is invisible but not "gone" because I need it to accept certain gestures but not others. I can't seem to be able to do that. Returning false from "onTouch" simply doesn't work.

I checked that by experiment by disabling the GestureDetector and simply always returning false just to see what would happen. Result was nothing going through.

Is it even possible to pass a click through to a covered app?


Solution

  • Due to security reasons it's not possible to record and pass a click below (essentially allows building a keylogger).

    Best you can do is have your floating window small enough to start the touch but not cover too much of the screen below.