如何在Android的推出主屏幕编程 [英] How to Launch Home Screen Programmatically in Android

查看:109
本文介绍了如何在Android的推出主屏幕编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要推出Android的主屏幕,我的申请。其主要目标是显示所有的应用程序给用户,当他/她presses一个专门的键。实际上,该方法是不重要的。任何想法做到这一点?

I want to launch home screen of Android with my application. The main target is to show all of apps to user when he/she presses a specialized key. Actually, the way is not important. Any idea to do this?

推荐答案

下面是code,起HomeActivity

Here is the code for starting HomeActivity

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

这篇关于如何在Android的推出主屏幕编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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