Created
April 9, 2018 08:55
-
-
Save danikx/46b00054be062756e019b602eafe9e9c to your computer and use it in GitHub Desktop.
Prevent screen capturing is way for saving your content.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Android SDK have special flag for it. | |
https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE | |
Just declare it in your Activity like this: | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE); | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
..... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.hrupin.com