如何应对Android的电源按钮正常 [英] How to react to android power button properly

查看:177
本文介绍了如何应对Android的电源按钮正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用电源按钮一按通,使对讲机应用程序。
因此,我需要更换按钮的behavoir到
使用的onkeydown的onkeyup或OnKeyLong pressed()触发事件的作品接受,但处理THRE触发事件后,屏幕熄灭。

I want to make a walkie-talkie app using the power button as Push-to-talk. Therefore i need to replace the button's behavoir to Using onKeyDown onKeyUp or OnKeyLongPressed() trigger events works to receive, but after thre trigger event is processed, screen goes off.

我有什么发现搜索
覆盖在Android中电源按钮
如何挂钩到Android中的电源按钮?
并不能帮助我,因为我无法得到的CyanogenMod这个手机上运行。

What i have found searching Overriding the power button in Android How to hook into the Power button in Android? doesn't help me since i can't get the Cyanogenmod to work on this phone.

也许你有一些想法。

感谢您提前。

推荐答案

您不能更改电源按钮的行为,除了通过自己的自定义ROM MOD(例如,CyanogenMod的)。

You cannot change the behavior of the power button, except via your own custom ROM mod (e.g., CyanogenMod).

这篇关于如何应对Android的电源按钮正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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