0

I try to make a service who put an invisible overlay (transparent layout) on top of everything and detect the gesture for bind an event.
but when the overlay is on top, everything under is inaccessible (Applications).
I have use this example : http://www.jawsware.mobi/code_OverlayView/

How to create an overlay to catch gesture without trouble the others applications.

Pixel
  • 1,946
  • 2
  • 15
  • 26
  • Check that post http://stackoverflow.com/questions/10216937/how-do-i-create-a-help-overlay-like-you-see-in-a-few-android-apps-and-ics hope it helps – JossVAMOS Oct 15 '14 at 12:19

1 Answers1

0

Let's assume you ordinarily would call setContentView(R.layout.main), but on first run, you want to have this overlay.

Step #1: Create a FrameLayout in Java code and pass that to setContentView().

Step #2: Use LayoutInflater to inflate R.layout.main into the FrameLayout.

Step #3: Use LayoutInflater to inflate the overlay into the FrameLayout.

Step #4: When the user taps the button (or whatever) to dismiss the overlay, call removeView() to remove the overlay from the FrameLayout.

Since the overlay is a later child of the FrameLayout, it will float over top of the contents of `R.layout.main

JossVAMOS
  • 300
  • 1
  • 5
  • 20