I'm using TextInputEditText
with databinding
- it was running fine until recently. Here's one of the layouts that got this problem:
<android.support.design.widget.TextInputLayout
android:id="@+id/new_pass_confirm"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:hint="@string/new_pass_confirm_hint"
app:errorEnabled="true"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/new_pass_confirm_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:enabled="@{viewmodel.enabled && !viewmodel.progress}"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:maxLines="1"
android:text="@={viewmodel.newPassConfirm}"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
But now whenever user tries to enter anything, app freezes and logcat
gets flooded with repeated messages over and over:
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@ccaf106 nm : package.my ic=com.android.internal.widget.EditableInputConnection@87ca3c7
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@e26ddb nm : package.my ic=com.android.internal.widget.EditableInputConnection@43b078
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
V/InputMethodManager: Starting input: tba=android.view.inputmethod.EditorInfo@4fff78e nm : package.my ic=com.android.internal.widget.EditableInputConnection@43ddbaf
I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus
W/IInputConnectionWrapper: getCursorCapsMode on inactive InputConnection
The problem dissapears if I remove android:text="@={viewmodel.newPassConfirm}"
Looks like the problem is with val newPassConfirm = ObservableField("")
trying to change xml-field in an endless loop
It worked fine until few days ago What I've tried:
removing
android:imeOptions="actionDone"
removing
android:inputType="textPassword"
removed each of the below from the view layer:
binding.newPassConfirm.setOnClickListener(v -> binding.newPassConfirm.setError(null)); binding.newPassConfirmEt.addTextChangedListener(new DefaultTextWatcher() { @Override public void afterTextChanged(Editable s) { binding.newPassConfirm.setError(null); } }); binding.newPassConfirmEt.setOnEditorActionListener( (v, actionId, event) -> { if (actionId == EditorInfo.IME_ACTION_DONE || event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) { mViewModel.onOkClick(); return true; } return false; });