2

User sends current running application in android device to background and when try to see all background application in device user should not able to see content of the background application. instead of that user has to see either blurred or blank screen and on tap it when application comes on foreground user can able to see actual content.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
bhaskar
  • 50
  • 8
  • 2
    Possible duplicate of [How do I prevent Android taking a screenshot when my app goes to the background?](https://stackoverflow.com/questions/9822076/how-do-i-prevent-android-taking-a-screenshot-when-my-app-goes-to-the-background) – Rob Jan 11 '19 at 11:08

1 Answers1

3

Set this in onCreate method between super.onCreate(savedInstanceState) and setContentView:

 // White image on recent apps overview and disable screenshot functionality
 window.setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE)
Prexx
  • 2,959
  • 5
  • 31
  • 48