fix nullref on exiting dialer by long pressing of Back key on KYF33 (#262)
* fix nullref on exiting com.android.dialer by long pressing of Back key on KYF33 * fix misleading ModeDialer.toString() * fix textField and inputType are assumed to be defined everywhere * fix yet another potential case of currentInputConnection = null --------- Co-authored-by: sspanak <doftor.livain@gmail.com>
This commit is contained in:
parent
b3fde40aa2
commit
7f6af7d413
3 changed files with 15 additions and 2 deletions
|
|
@ -82,6 +82,7 @@ abstract class KeyPadHandler extends InputMethodService {
|
|||
|
||||
@Override
|
||||
public void onStartInputView(EditorInfo inputField, boolean restarting) {
|
||||
currentInputConnection = getCurrentInputConnection();
|
||||
onRestart(inputField);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import android.view.View;
|
|||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -27,8 +29,10 @@ import io.github.sspanak.tt9.ui.tray.SuggestionsBar;
|
|||
public class TraditionalT9 extends KeyPadHandler {
|
||||
// internal settings/data
|
||||
private boolean isActive = false;
|
||||
private TextField textField;
|
||||
private InputType inputType;
|
||||
@NotNull
|
||||
private TextField textField = new TextField(null, null);
|
||||
@NotNull
|
||||
private InputType inputType = new InputType(null, null);
|
||||
|
||||
// editing mode
|
||||
protected static final int NON_EDIT = 0;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package io.github.sspanak.tt9.ime.modes;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import io.github.sspanak.tt9.ime.helpers.Key;
|
||||
|
||||
// see: InputType.isDialer()
|
||||
|
|
@ -12,4 +14,10 @@ public class ModeDialer extends Mode123 {
|
|||
public boolean onOtherKey(int key) {
|
||||
return !Key.isDecimalSeparator(key) && super.onOtherKey(key);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Dialer";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue