Skip to content

Commit df4cfa3

Browse files
Johan ErlandssonJean-Baptiste Queru
authored andcommitted
Start app with several activities with intent filter [Main, Launcher] was broken
When an application have more than one activities with intent filter [Main, Launcher], then the intent with ResolverActivity wasn't created correct. Change-Id: I2617122e07c35284862d2e0643888966ec0f7221
1 parent e74e7e2 commit df4cfa3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/java/android/app/ContextImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,8 +1687,9 @@ public Intent getLaunchIntentForPackage(String packageName) {
16871687
if (resolveInfo == null) {
16881688
return null;
16891689
}
1690-
Intent intent = new Intent(Intent.ACTION_MAIN);
1691-
intent.setClassName(packageName, resolveInfo.activityInfo.name);
1690+
Intent intent = new Intent(intentToResolve);
1691+
intent.setClassName(resolveInfo.activityInfo.applicationInfo.packageName,
1692+
resolveInfo.activityInfo.name);
16921693
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
16931694
return intent;
16941695
}

0 commit comments

Comments
 (0)