How to achieve black screen in our app while some one using screen recording, I seen this in GPay app while i tried payment transaction, that payment part is displayed as black screen in recorded video How to achieve in android app;
Asked
Active
Viewed 472 times
1 Answers
1
in onCreate()
method of activity (in which you want to disable recording/screenshot), add flag FLAG_SECURE
. as (in kotlin):
window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
this will prevent any screenshot or screen recording.

Nilesh B
- 937
- 1
- 9
- 14