http://stackoverflow.com/questions/3898876/how-to-disable-the-home-key
This solution works from android 2.1,
Okay, this was supposed to be a hard question. But here is a way to crack it.
Override the below method in your Activity,
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
}
And now handle the key event like this,
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_HOME)
{
Log.i("Home Button","Clicked");
}
if(keyCode==KeyEvent.KEYCODE_BACK)
{
finish();
}
return false;
};
分享到:
相关推荐
此代码来自于https://github.com/shaobin0604/Android-HomeKey-Locker。目测有效文件存在于HomeLockerLib和HomeLockerSample文件夹。
Android-HomeKey-Locker Utility to disable HOME KEY in Android Activity. As there are a lot questions about "how to disable home button in android?" on Stack Overflow, such as how to disable home ...
Android 屏蔽home,菜单,返回键 解锁,加锁
Android USB直接与USB Key通信实例,此例子实现Android通过USB直接与ePass3000GM USB Key通信,并利用USB Key进行国密对称加密解密,取随机数等。
申请Android Google Map API key
android 平台实现全局悬浮button,可以实现返回,menu等功能,代码可以参考。
Android LockScreenSample Using Service - Disable HomeButton Key Event LockScreenSample use Android Service. So, Ignores HomeButton Key Event. Download Current version: [1.0.2] Gradle: compile '...
一个简单的Android按键监听程序,通过通过BroadcastReceiver监听Home,电源Power,和音量变化Volume键
DRM Key, Attestation Key, IFAA Key, SOTER Key, RPMB Key
This project includes a proof of concept for Android bug 8219321, 9695860, and 9950697 Android bug 9950697 This bug is the newest and also the most exploitable. ZipArbitrage uses this bug by default. ...
版本 AndroidKiller_v1.3.1 onekey-decompile-apk-1.0.1
eclipse项目。获取raw文件下的json文件。无需编写json数据里面key值的实体类,动态获取里面的键值对的值。并在列表显示
这个是android 打包中的那个资源 就是那个key 密码为linkyun
homewatcher,[安卓]Home Key监听器,有事可做,无事可做,这意味着当用户点击后退或最近的应用程序或Home Key时,不要退出应用程序。.zip
Input Event Analyzer用于解析adb shellgetevent 命令产生的.input设备event序列. 使用VS2010开发环境, MFC C++语言编写. 主要实现以下功能: (1) input设备属性的解析 (2) TP的touch/key的事件解析 (3) touch事件...
Adb Key Monkey Fastest Adb Keyboard Tool for control android device via PC keyboard Requirement: Java 7 runtime (JRE7) or higher Sdk/platform-tools has to be in PATH env variable in order to find ...
使用android stutio开发移动应用,打包apk时需要的key生成文件。密码android。
義隆home key promotion file
列举了所有keyCode的值,方便开发者利用。
Android微信朋友圈多图片分享加文字描述,不用申请key,不用第三方sdk