可以直接通过获取焦点的方法解决:
public class MyOnFocusChangeListener implements View.OnFocusChangeListener {
@Override
public void onFocusChange(View view, boolean b) {
if (b) {
EditText et = (EditText) view;
et.setText("");
et.invalidate();
}
}
}
网友评论