在做一个注册界面,类似于https://mail.sina.com.cn/register/regmail.php
求教:在输入密码和确认密码后,点击到手机号码中时就验证两次密码是否一致。要逻辑清晰点儿的代码。先谢谢大神!
在做一个注册界面,类似于https://mail.sina.com.cn/register/regmail.php
求教:在输入密码和确认密码后,点击到手机号码中时就验证两次密码是否一致。要逻辑清晰点儿的代码。先谢谢大神!
EditText a=(EditText)findViewById(R.id.a);
a.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
// TODO Auto-generated method stub
if(hasFocus){
//获得焦点处理
}
else {
//失去焦点处理
}
}
});
你只要在自己想要实现验证效果的编辑控件中加入上面的监听,(具体验证,想必不用说了吧)!