Android 在其他应用程序快捷方式图标上打开相同的应用程序

Android 在其他应用程序快捷方式图标上打开相同的应用程序,android,Android,在安装其他应用程序后,我在主页上创建了一个快捷方式图标。我可以在主页上添加快捷方式图标,但单击快捷方式图标后,只有我的应用程序处于打开状态 我的代码: Intent shortcutIntent = new Intent(context, list.get(i).activityInfo.name.getClass()); shortcutIntent.setAction(Intent.ACTION_MAIN); Intent addIntent

在安装其他应用程序后,我在主页上创建了一个快捷方式图标。我可以在主页上添加快捷方式图标,但单击快捷方式图标后,只有我的应用程序处于打开状态

我的代码:

Intent shortcutIntent = new Intent(context,
                        list.get(i).activityInfo.name.getClass());
shortcutIntent.setAction(Intent.ACTION_MAIN);
Intent addIntent = new Intent();
addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,
                     manager.getApplicationLabel(list.get(i).activityInfo.applicationInfo));
addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
Parcelable icon = Intent.ShortcutIconResource.fromContext(context, list.get(i).activityInfo.icon);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);
context.sendBroadcast(addIntent);
列表类型为ResolveInfo