3

I am currently working on a webpage. One of the requirements is to prevent any ANDROID DEVICE from taking a screenshot of the said page. I found this block of codes but this is in Java. Is there any equivalent javascript or php code for 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 do I prevent Android taking a screenshot when my app goes to the background?

Community
  • 1
  • 1
gracia16
  • 113
  • 1
  • 6

1 Answers1

1

There is nothing you can do by just having a web page. If you have this requirement, you will also have to make a native android browser also.

Sanket Berde
  • 6,555
  • 4
  • 35
  • 39
  • If it couldn't be prevented, then is there any ways or means to make it a bit complicated or difficult for the user to screenshot the page? – gracia16 Jun 29 '15 at 07:55
  • Nothing can be done there as a web page, sorry. Screenshot is a OS level feature and if you need to prevent it, you atleast need a native app running. Browsers by default allow screenshots. – Sanket Berde Jun 29 '15 at 17:35