禁用屏幕截图在我的Andr​​oid应用程序 [英] Disable screen shot in my android app

查看:223
本文介绍了禁用屏幕截图在我的Andr​​oid应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我目前的Andr​​oid应用程序,不允许用户采取屏幕快照

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

我使用 getWindow()setFlags(LayoutParams.FLAG_SECURE,LayoutParams.FLAG_SECURE)​​; 在我的onCreate()方法和工作完美的罚款。

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

现在我的问题是在我的屏幕我浏览用户谷歌与一些路线图之一。我不希望用户采取屏幕快照在该屏幕了。我目前的执行情况禁止用户采取屏幕截图我的应用程序。但我不希望出现这种情况,用户可以采取截屏谷歌地图的太多,当他去,从我的应用程序。是否有这个或任何变通的任何解决方案。任何帮助将b高度AP preciated。

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.

推荐答案

而不是促使第三方应用程序,可以考虑使用<一个href="https://developers.google.com/maps/documentation/android/v1/reference/com/google/android/maps/MapActivity"相对=nofollow> MapActivity 。

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.

就像你做的其他活动将同code在OnCreate()方法。

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

这篇关于禁用屏幕截图在我的Andr​​oid应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆