From 4a78b580dcd2c7060b573872c51e631268ff20c7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 22 May 2018 14:28:45 +0200 Subject: [PATCH] get proper app launcher icons at apps from the suite --- .../applauncher/adapters/LaunchersAdapter.kt | 2 +- .../com/simplemobiletools/applauncher/helpers/DBHelper.kt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/LaunchersAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/LaunchersAdapter.kt index 9a2216b..82acbf4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/LaunchersAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/LaunchersAdapter.kt @@ -41,7 +41,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList + val view = holder.bindView(launcher) { itemView, adapterPosition -> setupView(itemView, launcher) } bindViewHolder(holder, position, view) diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt index 9f40517..92aa404 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt @@ -123,7 +123,11 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont val packageName = cursor.getStringValue(COL_PKG_NAME) val drawable = if (packageName.isAPredefinedApp()) { - resources.getLauncherDrawable(packageName) + try { + packageManager.getApplicationIcon(packageName) + } catch (e: PackageManager.NameNotFoundException) { + resources.getLauncherDrawable(packageName) + } } else { try { packageManager.getApplicationIcon(packageName)