Reputation: 11
I made an android app and I don't want people to take screenshots or record video and was wondering if there was a way to disable screenshots or make them appear blank. Both iOS and Android Studio.
Upvotes: 0
Views: 86
Reputation: 1970
In case of android take a look for the Window flag LayoutParams.FLAG_SECURE
. The documentation tells You that after applying this flag to Your window e.g. like this:
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
// or like this
getWindow().addFlags(LayoutParams.FLAG_SECURE);
android will:
treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays.
Upvotes: 1