0

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;

appukrb
  • 1,369
  • 2
  • 22
  • 50

1 Answers1

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
  • 742
  • 1
  • 7
  • 12