Is it possible to detect what the default launcher app is on a device from within your app?
I am poking around with PackageManager but don’t seem to see what i am looking for, i would like my app of launcher type to behave differently when set as the default launcher so i am trying to programmatically detect whether the use has set it to be the default launcher or not
the code i tried below returns Android System no matter what i set as the default launcher:
pm = getApplicationContext().getPackageManager();
Intent i = (new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER));
final ResolveInfo mInfo = pm.resolveActivity(i, 0);
Log.v("curent default launcher",":::::::::"+ pm.getApplicationLabel(mInfo.activityInfo.applicationInfo));
In the example that Google provides for a launcher replacement the activity has the following definition in the manifest:
Based on that you should add the following categories for querying for the launcher