From cf447a96b5cd86d2a35fb596b43399025c850f92 Mon Sep 17 00:00:00 2001 From: SunriseAndDawn <106006955+SunriseAndDawn@users.noreply.github.com> Date: Sun, 29 May 2022 16:23:22 +0800 Subject: [PATCH] Update LauncherActivity.java --- .../lastlauncher/LauncherActivity.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/src/main/java/io/github/subhamtyagi/lastlauncher/LauncherActivity.java b/app/src/main/java/io/github/subhamtyagi/lastlauncher/LauncherActivity.java index e333fe7f..d670cbd2 100644 --- a/app/src/main/java/io/github/subhamtyagi/lastlauncher/LauncherActivity.java +++ b/app/src/main/java/io/github/subhamtyagi/lastlauncher/LauncherActivity.java @@ -320,6 +320,25 @@ public void loadApps() { PackageManager pm = getPackageManager(); List activities = pm.queryIntentActivities(startupIntent, 0); + + Iterator iter = activities.iterator(); + ResolveInfo rf; + String appname; + while(iter.hasNext()){ + rf=iter.next(); + String tempPackage = rf.activityInfo.packageName; + // activity name as com.example/com.example.MainActivity + String activity = rf + "/" + rf.activityInfo.name; + /// save the app original name so that we can use this later e.g if user change + /// the app name then we have the name in DB + //DbUtils.putAppOriginalName(activity, rf.loadLabel(pm).toString()); + // check whether user set the custom app name for eg. long name to small name + appname = DbUtils.getAppName(activity, rf.loadLabel(pm).toString()); + if(appname.equals("Last Launcher Dev")){ + iter.remove(); + } + } + // check whether our app list is already initialized if yes then clear this(when new app or shortcut installed) if (mAppsList != null) { mAppsList.clear();