mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-04-16 19:07:32 +02:00
fix #52, use properly localized app launcher labels
This commit is contained in:
parent
78ee51acf5
commit
8e703e02b4
@ -125,7 +125,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
cursor.use {
|
cursor.use {
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
val id = cursor.getIntValue(COL_ID)
|
val id = cursor.getIntValue(COL_ID)
|
||||||
val name = cursor.getStringValue(COL_NAME)
|
var name = cursor.getStringValue(COL_NAME)
|
||||||
val packageName = cursor.getStringValue(COL_PKG_NAME)
|
val packageName = cursor.getStringValue(COL_PKG_NAME)
|
||||||
|
|
||||||
var drawable: Drawable? = null
|
var drawable: Drawable? = null
|
||||||
@ -135,6 +135,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
val launcher = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
|
val launcher = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
|
||||||
val activityList = launcher.getActivityList(packageName, android.os.Process.myUserHandle())[0]
|
val activityList = launcher.getActivityList(packageName, android.os.Process.myUserHandle())[0]
|
||||||
drawable = activityList.getBadgedIcon(0)
|
drawable = activityList.getBadgedIcon(0)
|
||||||
|
name = activityList.label.toString()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user