Fix list exception (regression from previous Neo commit)

This commit is contained in:
Andreas Shimokawa 2021-03-24 10:49:46 +01:00
parent 1c3398a319
commit 6f6db01bce

View File

@ -2445,7 +2445,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
protected HuamiSupport setDisplayItemsNew(TransactionBuilder builder, boolean isShortcuts, boolean forceWatchface, int defaultSettings) { protected HuamiSupport setDisplayItemsNew(TransactionBuilder builder, boolean isShortcuts, boolean forceWatchface, int defaultSettings) {
SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress()); SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress());
String pages; String pages;
List<String> enabledList; ArrayList<String> enabledList;
byte menuType; byte menuType;
if (isShortcuts) { if (isShortcuts) {
menuType = (byte) 0xfd; menuType = (byte) 0xfd;
@ -2457,9 +2457,9 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
LOG.info("Setting menu items"); LOG.info("Setting menu items");
} }
if (pages == null) { if (pages == null) {
enabledList = Arrays.asList(getContext().getResources().getStringArray(defaultSettings)); enabledList = new ArrayList<>(Arrays.asList(getContext().getResources().getStringArray(defaultSettings)));
} else { } else {
enabledList = Arrays.asList(pages.split(",")); enabledList = new ArrayList<>(Arrays.asList(pages.split(",")));
} }
if (forceWatchface) { if (forceWatchface) {
enabledList.add(0, "watchface"); enabledList.add(0, "watchface");