diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictListPreference.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictListPreference.java index 1f2a2b6d6..a300f4f43 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictListPreference.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DictListPreference.java @@ -54,6 +54,9 @@ public class DictListPreference extends XWListPreference { curLang = LocUtils.getString( context, R.string.lang_name_english ); } ISOCode isoCode = DictLangCache.getLangIsoCode( context, curLang ); + if ( null == isoCode ) { // work around crash reported via Play Store + isoCode = Utils.ISO_EN; + } DictUtils.DictAndLoc[] dals = DictUtils.dictList( context ); ArrayList dictEntries = new ArrayList<>(); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java index 46f18da7d..58db4364a 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/MQTTUtils.java @@ -1,7 +1,7 @@ /* -*- compile-command: "find-and-gradle.sh inXw4dDeb"; -*- */ /* - * Copyright 2009 - 2020 by Eric House (xwords@eehouse.org). All - * rights reserved. + * Copyright 2009 - 2022 by Eric House (xwords@eehouse.org). All rights + * reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -23,6 +23,7 @@ package org.eehouse.android.xw4; import android.content.Context; import android.content.Intent; import android.os.Build; +import android.text.TextUtils; import org.eclipse.paho.client.mqttv3.IMqttActionListener; import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; @@ -472,7 +473,7 @@ public class MQTTUtils extends Thread switch ( ii ) { case 0: action = "unsubscribe"; - token = client.unsubscribe( mDevID ); + token = client.unsubscribe( mTopics ); break; // not continue, which skips the Log() below case 1: action = "disconnect"; @@ -617,7 +618,7 @@ public class MQTTUtils extends Thread setState( State.SUBSCRIBING ); try { mClient.subscribe( mTopics, qoss, null, this ); - // Log.d( TAG, "subscribed to %s", mTopic ); + // Log.d( TAG, "subscribed to %s", TextUtils.join( ", ", mTopics ) ); } catch ( MqttException ex ) { ex.printStackTrace(); } catch ( Exception ex ) { diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommonPrefs.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommonPrefs.java index bae44c6d8..bacba9703 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommonPrefs.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/CommonPrefs.java @@ -26,7 +26,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.net.Uri; import android.os.Build; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import org.eehouse.android.xw4.Assert; import org.eehouse.android.xw4.DictUtils;