我想知道设备主页按钮执行的具体操作是什么?即单击主页按钮时发出的 Intent 、 Intent 类别和操作是什么?回到空白的主屏幕。我想知道在单击我自己的自定义按钮时执行此操作所涉及的内容。谢谢(PS 我知道这不是标准的,但我的设备也不是)。
最佳答案
如果你想显示主屏幕,你可以这样做:
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
关于Android - 主页按钮发出什么 Intent ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5520499/