I developed one simple app, like subtraction, addition.
In this app I use three EditTexts, one for answer and other two for question.
I want to calculate the answer of question on text change event. But when I apply the text change event on both of this the event occur but not properly work. Because when I enter in the text in first EditText of question the event occur but it throws this exception:
07-03 16:39:48.844: E/EduApp Log :=>(12537): Error In Text change Event java.lang.NumberFormatException: unable to parse '' as integer
What do I do?
I use the TextWatcher
for text change event.
txtOne.addTextChangedListener(this);
txtTwo.addTextChangedListener(this);
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
public void onTextChanged(CharSequence s, int start, int before, int count) {}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…