how to prevent screen capture in android

Solutions on MaxInterview for how to prevent screen capture in android by the best coders in the world

showing results for - "how to prevent screen capture in android"
Lucia
26 Feb 2018
1/*
2* Go to MainActivity.java file Add following import statements
3*/ 
4import android.view.WindowManager;
5import android.os.Bundle;
6/*
7* Add following method in MainActivity class to Prevent Screen Capture in Android
8*/ 
9@Override
10protected void onCreate(Bundle savedInstanceState) {    
11  super.onCreate(savedInstanceState);
12  getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
13}
14