4

Headsup! The following question might be a very silly question.

I know from API level 9 Android has introduced android:filterTouchesWhenObscured to prevent tap jacking in Android apps.

My question is will it be enough if I add this attribute to the root of a layout file or do I have to add this to each view inside a layout file?

Which one is advisable?

Kannan_SJD
  • 1,022
  • 2
  • 13
  • 32

1 Answers1

6

As per doc:

If android:filterTouchesWhenObscured is set to true, the View will not receive touches whenever view's window is obscured by another visible window.

My question is will it be enough if I add this attribute to the root of a layout file or do I have to add this to each view inside a layout file?

Yes, it'll be enough to add this attribute to the root of the layout file. However, only the area covered by overlapping View won't be touchable.

For more details, you can also read "Security" section under View

sneharc
  • 493
  • 3
  • 21