检测截图Android [英] Detect a screenshot 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屋!