Android的 - 意图做什么home键的问题?做什么、意图、问题、Android

2023-09-05 09:23:29 作者:呆呆′維她命

我想知道到底是什么操作设备的主页按钮进行?即什么意图,意图类和行动当你点击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);

更新:选中此示例应用程序:http://developer.android.com/resources/samples/Home/index.html

 
精彩推荐