在这里,我希望每当用户更改edittext的值时,textview的值也会随着使用乘以数量edittext而改变,但每当我想在更改edittext值之前出现错误消息时,找不到源代码 - VeiwRootImpl .deliverInputEvent(ViewRoot $ QueueInputEvent)行:3125
我也放了一些代码: -
edit_qty_regular_code.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
text_price_regular_code.setText (Integer.toString(qty));
}
public void beforeTextChanged(CharSequence s, int start,
int count, int after) {
x=Integer.parseInt(text_price_regular_code.getText().toString());
}
public void onTextChanged(CharSequence s, int start,
int before, int count)
{
qty=Integer.parseInt (edit_qty_regular_code.getText().toString());
qty=(int) ((int)qty*(int)x);
}
});
Logcat报告
10-13 14:06:26.359: I/System.out(664): waiting for debugger to settle...
10-13 14:06:26.559: I/System.out(664): debugger has settled (1478)
10-13 14:06:28.019:
D/dalvikvm(664): GC_CONCURRENT freed 82K,
3% free 8328K/8519K, paused 34ms+20ms, total 125ms
10-13 14:06:28.880: I/Choreographer(664): Skipped 61 frames!
The application may be doing too much work on its main thread.
10-13 14:06:29.199: D/gralloc_goldfish(664): Emulator without GPU emulation detected.
10-13 14:06:32.689: I/Choreographer(664): Skipped 227 frames!
The application may be doing too much work on its main thread.
但如果我将这四行代码放在复选框刻度事件中,那么我没有遇到问题...请告诉我我在哪里做错了