-1
et2.addTextChangedListener(new TextWatcher() {

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
        // TODO Auto-generated method stub
        et2 = (EditText) findViewById(R.id.editText2);
        area = Math.PI * radius * radius;
        String name = Double.toString(area);
        et2.setText(name);

    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count,
            int after) {
        // TODO Auto-generated method stub

    }

    @Override
    public void afterTextChanged(Editable s) {
        // TODO Auto-generated method stub

    }
});

05.156:I/Process(650):发送信号。PID:650 SIG:9

4

1 回答 1

0

在 Textchange 侦听器之前声明您的 edittext :

et2 = (EditText) findViewById(R.id.editText2);
et2.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count){
    // TODO Auto-generated method stub
    area = Math.PI * radius * radius;
    String name = Double.toString(area);
    et2.setText(name);
}
于 2013-01-31T13:52:28.210 回答