diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 52935ef7d..874d77f19 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -514,7 +514,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar super.setInputView(view); mCandidateViewContainer = view.findViewById(R.id.candidates_container); mCandidateView = (CandidateView) view.findViewById(R.id.candidates); - mCandidateView.setListener(this, view); + if (mCandidateView != null) + mCandidateView.setListener(this, view); mCandidateStripHeight = (int)mResources.getDimension(R.dimen.candidate_strip_height); } @@ -590,7 +591,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar inputView.setProximityCorrectionEnabled(true); // If we just entered a text field, maybe it has some old text that requires correction mRecorrection.checkRecorrectionOnStart(); - inputView.setForeground(true); voiceIme.onStartInputView(inputView.getWindowToken()); @@ -678,7 +678,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar public void onFinishInputView(boolean finishingInput) { super.onFinishInputView(finishingInput); KeyboardView inputView = mKeyboardSwitcher.getKeyboardView(); - if (inputView != null) inputView.setForeground(false); + if (inputView != null) inputView.cancelAllMessage(); // Remove pending messages related to update suggestions mHandler.cancelUpdateSuggestions(); mHandler.cancelUpdateOldSuggestions(); @@ -842,7 +842,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private void setSuggestionStripShownInternal(boolean shown, boolean needsInputViewShown) { // TODO: Modify this if we support candidates with hard keyboard - if (onEvaluateInputViewShown()) { + if (onEvaluateInputViewShown() && mCandidateViewContainer != null) { final boolean shouldShowCandidates = shown && (needsInputViewShown ? mKeyboardSwitcher.isInputViewShown() : true); if (isExtractViewShown()) { @@ -1869,6 +1869,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // Notify that language or mode have been changed and toggleLanguage will update KeyboardID // according to new language or mode. public void onRefreshKeyboard() { + if (!CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED) { + // Before Honeycomb, Voice IME is in LatinIME and it changes the current input view, + // 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(), mSubtypeSwitcher.isShortcutImeEnabled() && mVoiceProxy.isVoiceButtonEnabled(), |