When trying to look up how to block screenshots on Android, I noticed that many sites suggest[0] setting FLAG_SECURE
on the window and before calling setContentView()
.
I have been trying to understand why, but I'm not able to find anything. Looking at the source code for Window.setFlags()
, I can't see any difference Activity.setContentView()
would make.
[0]: example: https://commonsware.com/blog/2012/01/16/secure-against-screenshots.html , https://stackoverflow.com/a/29164604/1574325