I need to call the default home screen that comes with my phone from my application which is also a home screen app. I’ve tried searching 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 is working for the all the other launchers but not for the default launcher. I tried using break points in code and found that at 0 index of list there should be default launcher intent but intent does’nt hold the value. Do I need some kind of permission
thanks
you can just simple get the name and class from ResolveInfo and make intent manualy like for sonyercisson the package name is “com.sonyericsson.home” and class is “com.sonyericsson.home.HomeActivity”
it works