androidandroid-touch-event

Passing an 'onTouch' event to an activity below Android


I have an activity A. Activity B is partially transparent (so I can see activity A below).

Is there an option in Android to allow a user to interact with Activity A while B is still in front?

I want to leave activity B in front the whole time, but allow the user to interact with screen A.

overriding the implementation of onTouch or onClick in B so I can pass the event to activity A?


Solution

  • This is not possible and will not be, because it's a security concern. This on web is called clickjacking. The reason that this is not possible is because you could theoretically manipulate the user to do something unintended like deleting a file or similar, just by guiding them on where to click on a fake screen.