mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-06 23:57:40 +00:00
Add null check of keyboard list
This commit is contained in:
parent
d263b4c36e
commit
ea0d9be206
1 changed files with 2 additions and 1 deletions
|
|
@ -28,7 +28,8 @@ public class KeymanSettingsFragment extends PreferenceFragmentCompat {
|
|||
|
||||
Preference languagesPreference = new Preference(context);
|
||||
ArrayList<HashMap<String, String>> kbList = KMManager.getKeyboardsList(context);
|
||||
String keyboardCount = (kbList.size() > 1) ? String.format(" (%d)", kbList.size()) : "";
|
||||
String keyboardCount = (kbList != null && kbList.size() > 1) ?
|
||||
String.format(" (%d)", kbList.size()) : "";
|
||||
languagesPreference.setKey(KeymanSettingsActivity.installedLanguagesKey);
|
||||
languagesPreference.setTitle(getString(R.string.installed_languages) + keyboardCount);
|
||||
languagesPreference.setWidgetLayoutResource(R.layout.preference_icon_layout);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue