简体   繁体   English

我怎么知道用户是否截取了我的应用程序的屏幕截图?

[英]How can I know if the user took screenshot of my app?

My app represents funny sentences that my users upload, and in order to know which sentences are better I want to know if the user has taken a screenshot. 我的应用程序代表我的用户上传的有趣句子,并且为了知道哪些句子更好,我想知道用户是否截取了屏幕截图。 The only related thing I found is from Google Maps. 我找到的唯一相关内容来自谷歌地图。 Anyone know how to make a "screenshot listener" or which method it invokes? 任何人都知道如何制作“屏幕截图监听器”或它调用哪种方法? Thanks. 谢谢。

One way to do this is by creating a class which is implementing FileObserver . 一种方法是创建一个实现FileObserver的类。 Then add listener when you are loading activity ( by using onStart() activity's method) and remove listener when you are going out of your activity (by using onStop() activity's method). 然后在加载活动时添加侦听器(通过使用onStart()活动的方法)并在离开活动时删除侦听器(通过使用onStop()activity的方法)。

Once you get FileObserver event, you have to be sure that is a picture creation. 一旦你获得FileObserver事件,你必须确保这是一个图片创建。

Note that this method is not 100% safe but it's simple to make it works ! 请注意,此方法不是100%安全,但它很容易使它工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我怎么知道我的应用程序已被删除? - How can I know if my app is removed? 如何知道哪个Google帐户(电子邮件ID)用户在我的应用中购买了产品? - How can I know from which Google account (Email id) user purchased a product in my app? 我如何知道用户是否已安装并打开我的应用程序? - How do I know if a user has my app installed and opened? 在我的应用程序中,我无法将我从相机拍摄的照片传输到应用程序 - In my app I can't transfer the picture I took from the Camera to the app 如何截取我的 Xamarin.Forms 应用程序的部分屏幕截图并将其保存到我的库中? - How can I take a partial screenshot of my Xamarin.Forms app and save it into my gallery? 如何在Android应用中显示刚从相机拍摄的图像? - How do I display an image that I just took from my camera in my android app? 我如何知道我的应用程序的摄像头权限是否被授予? - How can I know if my app's camera permission is granted? 我怎么知道我的应用程序以前已经安装在手机上? - How can I know my app was previously installed on a phone? 我怎么知道我的应用程序的应用程序信息屏幕已打开 - How can I know that App info screen of My Application is opened Flutter - 如何知道用户是否共享了我的应用程序? - Flutter - How to know if user shared my app or not?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM