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
source
share