Call default home screen from application

I need to call the default home screen that comes with my phone from my application, which is also a home screen application. I tried to find and find this

    ArrayList<Intent> intentList = new ArrayList<Intent>();
    Intent intent=null;
    final PackageManager packageManager=getPackageManager();
    for(final ResolveInfo resolveInfo:packageManager.queryIntentActivities(new 
                  Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME), 
                                                        PackageManager.MATCH_DEFAULT_ONLY)) {
    intent=packageManager.getLaunchIntentForPackage(
                          resolveInfo.activityInfo.packageName);
    intentList.add(intent);
    }

This code works for all other launchers, but not for the default launch. I tried using breakpoints in the code and found that there should be a default launch intent in the 0 index of the list, but the intent does not hold the value. I need some permission thanks

+2
source share
2 answers

ResolveInfo , , sonyercisson - "com.sonyericsson.home", - "com.sonyericsson.home.HomeActivity"

   Intent intent = new Intent();
   intent.setClassName("com.sonyericsson.home", "com.sonyericsson.home.HomeActivity");
   intent.addCategory(Intent.CATEGORY_LAUNCHER);
   startActivity(intent);

+1

, .

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

All Articles