How to Launch Home Screen Programmatically in Android [duplicate] How to Launch Home Screen Programmatically in Android [duplicate] android android

How to Launch Home Screen Programmatically in Android [duplicate]


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);


The comments you made on some of the answers suggest you actually want to launch the Launcher (you may want to update the title if this is the case). To do this, use the same approach Anand proposed for launching the home activity.

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


There is no "screen that shows apps with their icons to users" in Android.

What you are thinking of is a feature of some home screens. There is no standardized Intent to trigger this to appear, and there is no requirement for home screens to have such a feature.

You are welcome to write your own. Here is a sample project that displays launchable activities in a ListView.