androidandroid-launcherandroid-package-managersdual-sim

Dual apps in Android launcher


I'm creating an Android launcher. Some users have dual apps set up, e.g. for work (like WhatsApp with a dual sim). Now, I want to display both the default and dual instance of these apps, but only the default instance is showing (which makes sense given that I store all apps in a HashMap by their packageNames and the packageName is unique per app). I've tried searching for a solution to find the dual instance of an app, but came up empty.

I'm querying for packages through the PackageManager's queryIntentActivities:

PackageManager packageManager = context.getPackageManager();
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> allActivities = packageManager.queryIntentActivities(mainIntent, 0);

Then I retrieve the packageName from the ResolveInfo of all activities and add it to the list of apps, if it wasn't in there already. How can I find out whether an app has a second instance which should be displayed in the launcher?


Solution

  • It looks like this dual app feature is currently not supported for third-party launchers.

    A solution we're proposing to users is to download an app like Dual Apps, Parallel Space or any other app that helps with accessing dual accounts from a different SIM.

    Hopefully in the future, third party launchers will also be able to use this dual app feature by themselves.