1

I have an overlay service which is activated from the edge of the screen and I want to implement View.setSystemGestureExclusionRects() for the edge. The documentation says that Window.setSystemGestureExclusionRects() can be used for apps with no view hierarchy, but how can I use it in the service if there is no way to get a reference to the Window object from the service?

RufusInZen
  • 2,119
  • 1
  • 19
  • 26

1 Answers1

0

If you are adding view to the service then you can exclude rectangles using that method. Because you can get window from the view's windowmanager.

you can find here that windowmanager is being used to add view in the service outside of an activity. So you can get window from that after adding the view.

If you want to eclude the gestures in your desired area, then you can follow my answer here.

Dev4Life
  • 2,328
  • 8
  • 22