EditText field causing double feed characters

  • Replies:1
Stephen Kong
  • Forum posts: 17

Oct 17, 2011, 1:01:00 AM via Website

Please review the following screenshoot



1. What is the bottom screen word matching/dictionary function? It seemed to be causing double feeding in the EditText field. (multiple characters show up as a result of a single keystroke)
2. How do I prevent the double feeding issue with this word matching/dictionary function enabled?
3. Is there a way to disable this word matching/dictionary function?

Reply
Stephen Kong
  • Forum posts: 17

Oct 18, 2011, 3:03:01 AM via Website

The double feeding issue is caused by the following listener code, but I don't understand why it could causes the issue.

1edittext.addTextChangedListener(new TextWatcher() {
2 public void afterTextChanged(Editable arg0) {
3 // TODO Auto-generated method stub
4 String text = arg0.toString().toUpperCase();
5
6 Log.d("EDIT", "Formatting text: " + text);
7
8 edittext.removeTextChangedListener(this);
9 edittext.setText(text);
10 edittext.setSelection(text.length());
11 edittext.addTextChangedListener(this);
12
13 Log.d("EDIT", "Formatting text completed");
14 }
15
16 public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
17 // TODO Auto-generated method stub
18 Log.d("BEFORE EDIT", "Before Text Change: " + arg0.toString());
19 }
20
21 public void onTextChanged(CharSequence s, int start, int before, int count) {
22 // TODO Auto-generated method stub
23 Log.d("EDITING", "During Text Changed: " + s.toString());
24 }
25 });

Reply