File tree Expand file tree Collapse file tree
common/src/main/java/com/omarea/common/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ class AdapterAppChooser(
7373 results.values = list
7474 results.count = list.size
7575 } else {
76- val prefixString = prefix.toLowerCase ()
76+ val prefixString = prefix.lowercase ()
7777
7878 val values: ArrayList <AppInfo >
7979 synchronized(adapter.mLock) {
@@ -89,8 +89,8 @@ class AdapterAppChooser(
8989 if (selected.contains(value)) {
9090 newValues.add(value)
9191 } else {
92- val labelText = value.appName.toLowerCase ()
93- val valueText = value.packageName.toLowerCase ()
92+ val labelText = value.appName.lowercase ()
93+ val valueText = value.packageName.lowercase ()
9494 if (searchStr(labelText, prefixString)) {
9595 newValues.add(value)
9696 } else if (searchStr(valueText, prefixString)) {
@@ -141,7 +141,12 @@ class AdapterAppChooser(
141141 val installInfo = context.packageManager.getPackageInfo(packageName, 0 )
142142 iconCaches.put(
143143 packageName,
144- installInfo.applicationInfo.loadIcon(context.packageManager)
144+ installInfo.applicationInfo?.let {
145+ iconCaches.put(
146+ packageName,
147+ it.loadIcon(context.packageManager)
148+ )
149+ }
145150 )
146151 } catch (ex: Exception ) {
147152 app.notFound = true
You can’t perform that action at this time.
0 commit comments