Basically, what happens, I will start typing on the keyboard (stock and side), and suddenly it stops showing the characters that I type in EditText (sometimes) resets the caret, but I know that I'm still typing, because that in the sentence field characters are displayed as you type. I tested the behavior on at least 5 different devices, as well as on the emulator, but did not seem to be able to solve the problem.
This is apparently random; I do not read error logs through DDMS from the system, so I'm a bit puzzled.
This is how it looks
Here is the EditText XML layout:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:transcriptMode="alwaysScroll"/> <EditText android:id="@+id/etMain" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="text|textAutoCorrect" android:imeOptions="actionSend"> <requestFocus /> </EditText> </LinearLayout>
And here is my code from Activity:
et = (EditText) findViewById(R.id.etMain); et.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || actionId == EditorInfo.IME_ACTION_SEND) { String sendText = v.getText().toString(); if (sendText.length() > 0) { v.setText(""); .... } } return true; } return false; } });
Please rate any information on how to fix this problem. Let me know if you need anything else ...
Thanks!
EDIT: It looks like the input method is disconnecting from the EditText in the middle of editing. Sometimes I get this warning when this happens: WARN / IInputConnectionWrapper (1035): endBatchEdit when InputConnection is inactive
source share