Skip to content

Commit 43c169f

Browse files
Fix: Correct app label display in HomeAppsWidgetProvider
This commit fixes an issue in `HomeAppsWidgetProvider.kt` where the app's package name was being used instead of the app's label. - The `packageName` variable is now correctly assigned `appModel.activityPackage` instead of `appModel.label`. - The app label is now correctly retrieved using `appModel.label` when getting the application info. Signed-off-by: CreativeCodeCat <wayne6324@gmail.com>
1 parent a61c988 commit 43c169f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/com/github/droidworksstudio/mlauncher/ui/widgets/home/HomeAppsWidgetProvider.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ class HomeAppsWidgetProvider : AppWidgetProvider() {
3636

3737
for (i in 0 until numApps) {
3838
val appModel = prefs.getHomeAppModel(i)
39-
val packageName = appModel.label
39+
val packageName = appModel.activityPackage
4040
if (packageName.isEmpty()) continue
4141

4242
val itemRv = RemoteViews(context.packageName, R.layout.item_home_app)
4343

4444
// --- App label ---
4545
val appLabel = try {
4646
context.packageManager.getApplicationLabel(
47-
context.packageManager.getApplicationInfo(packageName, 0)
47+
context.packageManager.getApplicationInfo(appModel.label, 0)
4848
).toString()
4949
} catch (_: Exception) {
50-
packageName
50+
appModel.label
5151
}
5252

5353
// --- Get icon safely ---

0 commit comments

Comments
 (0)