I'm working with the MediaProjection API in Android to record the screen. I've noticed that some built-in screen recorder apps manage to overlay icons on the screen during recording, but these icons are not included in the recorded video. How can I achieve this behavior using the MediaProjection API? Are there any specific techniques or options I should be aware of to exclude certain elements like overlays from the recorded content?
I expected that by implementing these approaches, I would be able to record the screen while excluding overlay icons or elements from the recorded video. The overlay icons should be visible during the recording but should not appear in the final recorded content.