diff --git a/lib/utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java b/lib/utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java index d49ce6ff0..00749262a 100644 --- a/lib/utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java +++ b/lib/utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java @@ -1475,7 +1475,13 @@ public static String getLauncherActivity(@NonNull final String pkg) { PackageManager pm = Utils.getApp().getPackageManager(); List info = pm.queryIntentActivities(intent, 0); if (info == null || info.size() == 0) { - return ""; + intent.removeCategory(Intent.CATEGORY_LAUNCHER); + intent.addCategory(Intent.CATEGORY_LEANBACK_LAUNCHER); + List leaninfo = pm.queryIntentActivities(intent, 0); + if(leaninfo == null || leaninfo.size() == 0){ + return ""; + } + return leaninfo.get(0).activityInfo.name; } return info.get(0).activityInfo.name; }