android how to determine if the edit text focus changes

Solutions on MaxInterview for android how to determine if the edit text focus changes by the best coders in the world

showing results for - "android how to determine if the edit text focus changes"
Melinda
14 Sep 2019
1for (EditText view : editList){
2   view.setOnFocusChangeListener(focusListener);
3}
4....
5private OnFocusChangeListener focusListener = new OnFocusChangeListener() {
6    public void onFocusChange(View v, boolean hasFocus) {
7        if (hasFocus){
8             focusedView = v;
9        } else {
10             focusedView  = null;
11        }
12    }
13}
14