From 1e39565bb48d23221145c494d4bf5665b514699d Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 4 Nov 2011 12:36:38 +0900 Subject: [PATCH] Skip loading keyboard when SoftInputWindow hasn't shown yet. Bug: 5541192 Change-Id: I003101b2a3fdeb5bb554d249634ec5ab50aea09e --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index fd833157d..a6a3a5c88 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2169,8 +2169,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // so that we need to re-create the keyboard input view here. setInputView(mKeyboardSwitcher.onCreateInputView()); } - // Reload keyboard because the current language has been changed. - mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), mSettingsValues); + // When the device locale is changed in SetupWizard etc., this method may get called via + // onConfigurationChanged before SoftInputWindow is shown. + if (mKeyboardSwitcher.getKeyboardView() != null) { + // Reload keyboard because the current language has been changed. + mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), mSettingsValues); + } initSuggest(); loadSettings(); }