0

How can I achieve this programmatically?

Screen sharing-Screen sharing feasibility in Application needs to be disabled, the user will not be allowed to share the screen or give remote access of the application via using any third-party app.

Phantômaxx
  • 36,442
  • 21
  • 78
  • 108
Aman Verma
  • 2,465
  • 4
  • 21
  • 41
  • Did you check out `FLAG_SECURE`? https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE – chrjs Apr 10 '19 at 08:20
  • I want to do it Application Wide. – Aman Verma Apr 10 '19 at 08:28
  • 2
    Create a `BaseActivity` with `FLAG_SECURE` and extends all other Activities from it . This is the only way i can think of. – ADM Apr 10 '19 at 09:06
  • Thanks. I had BaseActivity and all i have to do is add this before setcontentview - getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); – Aman Verma Apr 10 '19 at 11:34

1 Answers1

1

We cannot completely avoid screen sharing. FLAG_SECURE is a way to avoid screen capture or video capture. Have a look at this answer. link

Viswas Kg
  • 195
  • 11