Android EditText and addTextChangedListener
- by Alex
im currently porting a database manager to android and due to performance reasons i like
to update only propertys that have been modified. Im trying to do this with the addTextChangedListener in order to add modified entrys to a List, but my Program never enters any of its methods.
EditText Et = (EditText) Editors.get(Prop.Name);
Et.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
@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
if(Prop.GetType() == Property.PROPTYPE.num) {
float f = Float.parseFloat(s.toString());
Prop.FromString(f);
}
else {
Prop.FromString(s.toString());
}
propertiesToUpdate.add(Prop);
});
Et.setText(Prop.ToString());