Android的 - 意图做什么home键的问题? [英] Android - What Intent does home button issue?

查看:88
本文介绍了Android的 - 意图做什么home键的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道到底是什么操作设备的主页按钮进行?即什么意图,意图类和行动当你点击home键发出?这发生在回空白主屏幕。我想知道什么是参与实施该操作对我自己的自定义按钮,点击时发生的。谢谢(PS我知道这是不是标准的,但也不是我的设备)。

I would like to know exactly what operation a devices home button performs? ie what intent, intent category and action is issued when you click on home button? that takes on back to the blank home screen. I would like to know what is involved in implementing this operation to occur when clicking on my own custom button. Thanks (PS I know it is not standard, but neither is my device).

推荐答案

如果你想显示在主屏幕上,你可以做到这一点:

If you want to show the home screen, you can do it by:

Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);

更新:选中此示例应用程序:<一href="http://developer.android.com/resources/samples/Home/index.html">http://developer.android.com/resources/samples/Home/index.html

这篇关于Android的 - 意图做什么home键的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆