0

When the app is shown in the recents menu, I need to make the content blank, so that screenshots can not be taken. This flag works

 getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);

and the screen becomes empty white. I need to handle the scenario where the user has selected the dark mode, and so the screen must be empty dark.

What other options can I have other than using this flag?

gianpaolo
  • 753
  • 1
  • 14
  • 26

2 Answers2

1

Sorry, but you do not have control over how the OS displays your app in the overview screen, in terms of the color when FLAG_SECURE is used.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

I have found this library on github that solves the problem.

https://github.com/nimblehq/recent-apps-thumbnail-hiding

You can use custom layout for the recent app views.

gianpaolo
  • 753
  • 1
  • 14
  • 26