This code below causes infinate loop problem (as documented). So how do I set the editText contents? I have a text message app where the EditText says "Type to compose",I want to remove the instructions once a user starts to enter a message. TIA
et.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
if(et.getText().toString().equals(getString(R.string.txtMessage_type_to_compose))) {
try {
et.setText("");
} catch (Exception e) {
Log.d(TAG,"exception : " + e.toString());
}
}
});