Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable screen shot in my android app

I have my current android application which do not allow user to take screen shot.

I am using getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE); in my onCreate() method and working perfectly fine.

Now my problem is in one of my screen I am navigating user to Google map with some routes. I don't want user to take screen shot in that screen too. My current implementation disables user to take screen shot from my app. But I don't want that user can take screen shot of Google Map too when he goes from my app. Is there any solution for this or any work around. Any help will b highly appreciated.

like image 932
Android Avatar asked Jan 30 '13 05:01

Android


1 Answers

Instead of prompting the 3rd party app, consider using a MapActivity.

Then you can you can place a MapView in the layout and show the Map. In this case, you will be able to control the restriction via the secure flag.

Just place the same code in the onCreate() method like you did on the other activity.

like image 164
Calvin Avatar answered Oct 13 '22 11:10

Calvin