1. Download our Official Android App: Forums for Android!

EditText field causing double feed characters

Discussion in 'Android Apps & Games' started by zollen, Oct 16, 2011.

  1. zollen

    zollen Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    21
    Joined:
    Oct 11, 2011

    Oct 11, 2011
    21
    0
    15
    Please review the following screenshoot

    [​IMG]

    1. What is the bottom word screen 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?
     

    Advertisement

  2. zollen

    zollen Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    21
    Joined:
    Oct 11, 2011

    Oct 11, 2011
    21
    0
    15
    Upon further investigation, the following listener code seems to be causing the double feeding issue, but I don't understand why it could causes the issue.

    Code (Text):
    1. edittext.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.         });
     

Share This Page

Loading...