I am currently capturing the screen using media projection, on the screen running another application, now I want to add elements to a floating window and still capture only the layer below.
When using
layoutParams.flags = WindowManager.LayoutParams.FLAG_SECURE
the window part that I display is black, and cant see the layer below
Does any one know a way to capture the screen without my overlays?
To capture the screen without your overlays, you need to make sure that your floating window is transparent. You can achieve this by setting the alpha value of your floating window to 0, which will make it completely transparent.
Here's an example of how to create a transparent floating window:
// Create the layout for the floating window