adding a crashfix

This commit is contained in:
tibbi 2022-11-08 10:15:13 +01:00
parent 8707b03580
commit 3ebf3d4734

View File

@ -162,7 +162,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
if (keyboardMode != KEYBOARD_LETTERS && code == MyKeyboard.KEYCODE_SPACE) {
val originalText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text ?: return
inputConnection.commitText(codeChar.toString(), 1)
val newText = inputConnection.getExtractedText(ExtractedTextRequest(), 0).text
val newText = inputConnection.getExtractedText(ExtractedTextRequest(), 0)?.text
switchToLetters = originalText != newText
} else {
inputConnection.commitText(codeChar.toString(), 1)