检测截图Android [英] Detect a screenshot Android

查看:126
本文介绍了检测截图Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近几年把程序安装到Android,我想知道一些东西:用户如何检测屏幕截图?我想要的是当用户拍摄截图时,我们转到下一个活动。
我尝试拦截事件的方法,但是有一个问题:当设备进入睡眠时,例如事件被拦截。您是否有解决方案来拦截只有屏幕截图或忽略其他事件?



感谢您的帮助!

解决方案

没有直接的广播意图告诉你截图已被采用。
有些人 here 讨论可能的选择喜欢它在Snapchat上完成)。
一个可能的选择是使用 FileObserver


I program in recent years to Android and I wonder something : How to detect when user take a screenshot ? I want that when the user takes a screenshot , we move to the next activity . I tried the method of intercepting an event but there is a problem : when the device goes into sleep , for example, an event is intercepted . Do you have a solution for intercepts only the event of screenshot or ignore other event?

Thank you for your help !

解决方案

There is no direct Broadcast Intent to tell you that a screenshot has been taken. Some people here discuss possible options to do so ( like it's done on Snapchat ). One possible option would be to use FileObserver.

这篇关于检测截图Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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