我正在实施锁屏应用,用户需要输入密码并在一段时间内解锁设备。禁用Android主页按钮
我在三星Note 3和小米红米手机1.
所有注3物理按键已被锁定测试,但不知何故,我不能禁用小蜜红米手机1的home键。 **主页按钮将运行onPause事件。
我使用的代码无法显示logcat中的按钮。
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
Log.d("button", String.valueOf(event.getKeyCode()));
return true;
}
我尝试使用onPause并再次运行我的应用程序,但它响应缓慢。
@Override
public void onPause() {
super.onPause();.
Intent intent = new Intent(LockScreenActivity.this, SettingActivity.class);
startActivity(intent);
}
[如何禁用home键(http://stackoverflow.com/questions/3898876/how-to-disable-the-home-key) –
检查可能的复制这个http://stackoverflow.com/questions/3898876/how-to-disable-the-home-key –