android实现程序的后台运行
摘要:
改写返回键事件监听,使得back键功能类似home键,让Acitivty退至后台时不被系统销毁,代码如下:
public boolean onKeyDown(int keyCode, KeyEvent event) { PackageManager pm = getPackageManager(); ResolveInfo homeInfo = pm.resolveActivity(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME), 0); ... 阅读全文
posted @ 2012-04-16 23:38 c语言源码 阅读(958) 评论(0) 推荐(0) 编辑