How do I prevent an Android device from taking a screenshot of my webpage?

I am currently working on a web page. One of the requirements is to prevent ANDROID DEVICE from taking a screenshot of the specified page. I found this block of codes, but it's in Java. Is there any equivalent javascript or php code to do this? Can a webpage detect if a mobile device (Android) is trying to take a screenshot?

public class FlagSecureTestActivity extends Activity {
   @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

      getWindow().setFlags(LayoutParams.FLAG_SECURE,
                     LayoutParams.FLAG_SECURE);

      setContentView(R.layout.main);
   }
}

      

Source: How to prevent Android from taking a screenshot when my app goes into the background?

+3


source to share


1 answer


There is nothing you can do just by having a web page. If you have this requirement, you will also have to create your own Android browser.



+1


source







All Articles