Out of best practices and Android coding guidelines, recommendations were abstracted which state that for UI elements which might contain sensitive information, the
FLAG_SECURE
flag must be set.
Add the
FLAG_SECURE
setting to all your activities which handle sensitive information. This will prevent leaks via screenshots or recording software.
If you have other UI elements such as a Dialog or a Toast, you can use the
FlagSecureHelper
library to create a secure version of this element.