• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

EditText field causing double feed characters

zollen

Newbie
Please review the following screenshoot

apprx.jpg


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?
 
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:
edittext.addTextChangedListener(new TextWatcher() {
        	public void afterTextChanged(Editable arg0) {
        	    // TODO Auto-generated method stub
        		String text = arg0.toString().toUpperCase();
        		
        		Log.d("EDIT", "Formatting text: " + text);
        		
        		edittext.removeTextChangedListener(this);
        		edittext.setText(text);
        		edittext.setSelection(text.length());
        		edittext.addTextChangedListener(this);
        		
        		Log.d("EDIT", "Formatting text completed");
        	}
        
        	public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {
        	    // TODO Auto-generated method stub        		       		
        		Log.d("BEFORE EDIT", "Before Text Change: " + arg0.toString());
        	}
        	
        	public void onTextChanged(CharSequence s, int start, int before, int count) {
        	    // TODO Auto-generated method stub        		
        		Log.d("EDITING", "During Text Changed: " + s.toString());
        	}
        });
 
Back
Top Bottom