I am working on an Android application. In my application, I have to use text based images. Therefore, I am writing OnChangeListener() for EditText . The following is my sample code.
edt.addTextChangedListener(this); @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub CharSequence cs=convert(edt.getText.toString()); edt.setText(cs); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub }
But I get an exception for the above code. I know that the cause of the exception is the call to the setText() method from afterTextChanged() . But I need to change the text value of the EditText based on the same change in the text of the EditText . Help me friends
source share