Android的禁用所有的硬件键锁屏应用 [英] Android disable all hardware keys for lockscreen app
问题描述
我编码为Android定制锁屏应用。
I am coding a custom lockscreen app for android.
我已成功地禁用后退按钮。但是,home键和ICS最近的应用按钮证明不是那么容易。
I have managed to disable the back button. But the home button and the recent apps button on ICS proved not to be as easy.
我搜索周围,想出了:
@Override
public void onAttachedToWindow() {
// TODO Auto-generated method stub
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
然而,这将引发添加后抛出:IllegalArgumentException窗口类型不能改变。然后,我尝试将其设置为的onCreate(),但家里关键还是功能。
However, this throws IllegalArgumentException window type can not be changed after it is added. I then tried to set it in onCreate() but the home key still functions.
我愿意用root方法来实现这一目标。有什么办法把它做?
I am willing to use root methods to achieve this. Is there any way to get it done?
任何帮助将是AP preciated!
Any help would be appreciated!
推荐答案
有关的Android版本2.3以上,Home键的首要禁用
For android versions above 2.3, overriding of the Home button is disabled
这篇关于Android的禁用所有的硬件键锁屏应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!