gianpaolo
gianpaolo

Reputation: 903

Make the app content blank in the "recent apps" list

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?

Upvotes: 0

Views: 1263

Answers (2)

gianpaolo
gianpaolo

Reputation: 903

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.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006664

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.

Upvotes: 1

Related Questions