Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable screenshots in android ics

For one of our secure apps, there is a requirement to disable the screenshot capability for the app in Android ICS. Is this possible on a non-rooted device?
Thanks,
Rajath

like image 639
Rajath Avatar asked Feb 13 '12 08:02

Rajath


People also ask

How do I restrict screenshots on Android?

But if you only want to block it for normal android devices, the SECURE FLAG is substantial. 1) The secure flag does block both normal screenshot and video capture. Window flag: treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays.

Can you disable screenshot?

The Project Settings dialog box appears. From the left pane, expand the Native tab, and then select the Android Mobile/Tablet sub-tab. In the Miscellaneous section, enable the Disable Application Screenshot check box.


1 Answers

Why don't you add this line in your activity class. This will do the trick.

// This disables screen shot to be taken for current activity
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);

You may want to have a look at Mark Murphy's blog post.

like image 50
Android Avatar answered Oct 22 '22 08:10

Android