问题描述:EditText 点击两次才有响应事件;
解决方法( 亲测有效 ):
et_phone.setOnTouchListener(new View.OnTouchListener() {
//按住和松开的标识
int flag = 0;
@Override
public boolean onTouch(View v, MotionEvent event) {
flag++;
if (flag == 2) {
flag = 0;//不要忘记这句话
//处理逻辑
et_phone.setCursorVisible(true);
et_password.setCursorVisible(false);
}
return false;
}
});