protected static class BlurChangeListener implements OnFocusChangeListener {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
//do something
}
}
}
RT,怎么处理让其只是光标不在edittext上才回调?
PHP中文网2017-04-17 17:57:22
Finally, it was handled through the handler. When there is a keyboard, this method is continuously called back, so everything mentioned above has problems.
天蓬老师2017-04-17 17:57:22
Edittext does not steal focus.
Looking at your code, I guess you have set multiple Edittexts to this listener.
Then you should write it like this, like onclickListener
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
if(v.getId == R.id.et_id){
//do something
}
}
}
I’ve been reading about the problem for a long time. If it has been solved long ago, I suggest you answer the question yourself and adopt it. This will be better for everyone