EditText의 setFocusable을 text의 값이 변경될 때 적용합니다.
EditText edit_a = (EditText)findViewById(R.id.edit_a);
EditText edit_b = (EditText)findViewById(R.id.edit_b);
EditText edit_c = (EditText)findViewById(R.id.edit_c);
edit_a.addTextChangedListener(mOnWatcherAListener);
edit_b.addTextChangedListener(mOnWatcherBListener);
edit_c.addTextChangedListener(mOnWatcherCListener);
TextWatcher mOnWatcherAListener = new TextWatcher(){
....
public void onTextChanged(CharSequence s, int start, int before, int count) {
edit_a.setFocusable(false);
edit_b.setFocusable(true);
}
....
}
TextWatcher mOnWatcherBListener = new TextWatcher(){
....
public void onTextChanged(CharSequence s, int start, int before, int count) {
edit_b.setFocusable(false);
edit_c.setFocusable(true);
}
....
}
TextWatcher mOnWatcherCListener = new TextWatcher(){
....
public void onTextChanged(CharSequence s, int start, int before, int count) {
edit_c.setFocusable(false);
if(!isValid()){
edit_a.setFocusable(true); <- 이부분이 적용이 되지 않습니다.
}
}
....
}
setFocusable이 처음엔 적용이 되는 데 false한 걸 다시 true로 변경하면 적용이 되지 않습니다.
어떻게 해야하는 지 아시는 분 답변 부탁합니다.
무슨 용도로 만들려고 하는지 모르겠는데...
해당 함수는 focus를 가질 수 있게 하느냐 못하느냐 하는 함수로 알고 있는뎁쇼...
설마 focus 주는걸 하려는 거면 requestFocus 라는 함수가 있는 걸로...