Thursday, February 9, 2012

How to open Home Screen programatically in Android?


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

No comments:

Post a Comment