android 中捕获home键
来源:互联网 发布:linux怎么全局翻墙 编辑:程序博客网 时间:2024/05/17 01:09
覆写此两方法即可:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event){
// TODO Auto-generated method stub
Intent intent= new Intent(Intent.ACTION_MAIN);
if(KeyEvent.KEYCODE_HOME==keyCode) {
do something....... //捕获home键 做自己的事
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //如果是服务里调用,必须加入new task标识
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
}
return super.onKeyDown(keyCode, event);
}
@Override
public void onAttachedToWindow(){
// TODO Auto-generated method stub
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
- android 中捕获home键
- Android中捕获HOME键
- android 捕获home键
- android捕获home键
- Android捕获home键
- android捕获Home键
- android捕获home键
- Android 捕获HOME键
- android系统捕获home键
- android+捕获home键方法
- android+捕获home键方法
- Android 4.0 捕获Home键
- Android 4.0 捕获Home键
- android+捕获home键方法
- Android中中捕获HOME事件
- android back和home键的捕获
- android back和home键的捕获
- android Home键 屏蔽,捕获,修改
- python监视进程
- 开发线程安全的Servlet
- AIX上使用gcc和g++的一个编译问题的解决
- asp.net 中 Json、Jquery、Post简单使用
- android service生命周期
- android 中捕获home键
- c# 检测32/64系统
- list_for_each_entty函数
- form提交中文编码
- Prim_poj 1287 Networking
- POJ-3204 最大流+枚举
- java连接常见数据库的连接字符串
- VC6.0 最新的 SDK platform sdk xp-sp2 官方下载地址
- Hadoop HDFS源码学习笔记(七)--DFSInputStream -- openInfo