mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-18 13:47:42 +00:00
Merge pull request #6346 from keymanapp/fix/fv/android/prediction-toggle-crash
fix(oem/fv/android): Check keyboard exists before registering a model
This commit is contained in:
commit
e0992a49fa
1 changed files with 3 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ import com.tavultesoft.kmea.cloud.CloudDownloadMgr;
|
|||
import com.tavultesoft.kmea.cloud.impl.CloudLexicalModelMetaDataDownloadCallback;
|
||||
import com.tavultesoft.kmea.data.CloudRepository;
|
||||
import com.tavultesoft.kmea.data.Dataset;
|
||||
import com.tavultesoft.kmea.data.Keyboard;
|
||||
import com.tavultesoft.kmea.data.KeyboardController;
|
||||
import com.tavultesoft.kmea.util.BCP47;
|
||||
import com.tavultesoft.kmea.util.KMLog;
|
||||
|
|
@ -88,8 +89,8 @@ public final class FVKeyboardSettingsActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
// If the active keyboard is for this language, immediately enact the new pref setting.
|
||||
String kbdLgCode = KMManager.getCurrentKeyboardInfo(context).getLanguageID();
|
||||
if (BCP47.languageEquals(kbdLgCode, lgCode)) {
|
||||
Keyboard currentKeyboard = KMManager.getCurrentKeyboardInfo(context);
|
||||
if (currentKeyboard != null && BCP47.languageEquals(currentKeyboard.getLanguageID(), lgCode)) {
|
||||
// Not only registers the model but also applies our modeling preferences.
|
||||
KMManager.registerAssociatedLexicalModel(lgCode);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue