public static final int FLAG_HOMEKEY_DISPATCHED = 0x80000000; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.getWindow().setFlags(FLAG_HOMEKEY_DISPATCHED, FLAG_HOMEKEY_DISPATCHED);//关键代码 setContentView(R.layout.main); } 再重写onKey事件即可。
Android监听HOME键的最简单的方法,布布扣,bubuko.com
原文地址:http://blog.csdn.net/linglongxin24/article/details/37924355