Skip to content

Instantly share code, notes, and snippets.

@jbaginski
Created July 4, 2013 10:03
Show Gist options
  • Save jbaginski/5926481 to your computer and use it in GitHub Desktop.
Save jbaginski/5926481 to your computer and use it in GitHub Desktop.
this secures against manual and automatic screenshots http://stackoverflow.com/a/9822607
public class FlagSecureTestActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/**
* secure this activity
* {@link http://stackoverflow.com/a/9822607}
*/
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE);
setContentView(R.layout.main);
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment