0

我希望当你按下 TAB 键时移动到下一个 EditText。目前只添加空白,我正在使用 Android 2.3

任何人都知道任何方法吗?

谢谢!

4

1 回答 1

0

这就是我解决的方法:

private class GenericTextWatcher implements TextWatcher{

    private View view;
    private GenericTextWatcher(View view) {
        this.view = view;
    }


    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        switch(view.getId()){

        case R.id.txt_checklocation_location:
            if (txt_checklocation_location.getText().toString().endsWith("\t"))     
            txt_checklocation_location.focusSearch(View.FOCUS_DOWN).requestFocus();
            break;

    }
    }

    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}
    public void afterTextChanged(Editable editable) {}


}
于 2012-12-12T20:55:15.637 回答