如何捕获在Android上采取截图由volumn下来,电源键? [英] How to capture taking screenshot by volumn down and power keys on android?

查看:203
本文介绍了如何捕获在Android上采取截图由volumn下来,电源键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Android 4.0以上版本,它支持pressing volumn下+电源键截屏取。我要当通过热键采取截图后立即使用截屏图像。

有没有被用来作为事件的回调任何Android SDK API?那么我可以这样的监听器采取截图的注册事件。

威尔回吐向下卷+电源截图发送一些公共广播?然后,我可以收到此公开播出。

有什么办法来捕捉热键事件?当pressing volumn下+电源的同时,可我得到通知?


解决方案

  

是否有任何的Andr​​oid SDK API用作事件的回调?


不明确。你可以尝试监听通常与可用图像内容(例如, ContentResolver的 MediaStore )的变化事件,但这将包括其他的东西,比如由照相机拍摄的照片。


  

有什么办法来捕捉热键事件?


欢迎您来看看的onkeydown()前景的活性听到有关此事件的,虽然我对此表示怀疑。如果你的活动是不是在前台,你绝对不能听到有关此事件。

From android 4.0+, it supports to take screenshot by pressing volumn down+power keys. I'm going to use the screenshot image immediately when after taking screenshot by the hotkey.

Is there any Android SDK API to be used as a callback of the event? then I can register such listener to the event of taking screenshot.

Will taking screenshot by vol down+power send some public broadcast? then I can receive this public broadcast.

Is there any way to capture hotkey events? When pressing volumn down+power at the same time, can I get a notification?

解决方案

Is there any Android SDK API to be used as a callback of the event?

Not specifically. You could try listening for events related generally to changes in available image content (e.g., a ContentResolver on MediaStore), but that will cover other things, such as pictures taken by the camera.

Is there any way to capture hotkey events?

You are welcome to see if onKeyDown() of a foreground activity hears about this event, though I doubt it. And if your activity is not in the foreground, you definitely cannot hear about this event.

这篇关于如何捕获在Android上采取截图由volumn下来,电源键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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