title: Prevent screen capture in Unity Android app
body: <p>I'm trying to create a Unity Android plugin to prevent screenshots while running the app. I read the following.</p>
  
  <p><a href="https://stackoverflow.com/questions/9822076/how-do-i-prevent-android-taking-a-screenshot-when-my-app-goes-to-the-background">How do I prevent Android taking a screenshot when my app goes to the background?</a></p>
  
  <p>From what I have read I need to call the following in the Activity onCreate handler....</p>
  
  <pre><code>getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
  </code></pre>
  
  <p>But I have not been able to get this to work. I have tried extending UnityPlayerActivity, UnityPlayerNativeActivity, and even android.app.NativeActivity. I have verified that the plugin itself is working properly (I am able to call other functions in the plugin) and the onCreate method is getting executed. </p>
  
  <p>I have tried setting the flags in multiple places inside onCreate, such as before and/or after setContentView(mUnityPlayer), but it never works.</p>
  
  <p>I'm testing on an HTC One m8. Anyone know what the problem could be?</p>