实现setOnFocusChangeListener中的onFocusChange方法,在hasFocus中有一个boolean型参数。当它是false时,光标就会转到另一个控件。
EditText txtEdit= (EditText) findViewById(R.id.edittxt);
txtEdit.setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if(!hasFocus)
//do job here owhen Edittext lose focus
}
});