I have an EditText
View which is edited by setText()
from my code and by the user via (soft/hard) keyboard and - if possible by speech input. I wan
You can use a flag to differentiate.
((EditText) rootView.findViewById(R.id.editText1)).addTextChangedListener(new TextWatcher() {
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
public void afterTextChanged(Editable editable) {
update(true);
}
});
private boolean updating = false;
private void update(boolean multiply) {
if(updating){
return;
}
updating = true;
EditText editText1 = (EditText) getView().findViewById(R.id.editText1);
editText1.setText("XXX");
updating = false;
}