我想将光标从EditText1移动到另一个EditText2.我已经专注于editText1但是如何将光标移动到editText2.
解决方法
最后我得到了答案:
editText1.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s,int start,int before,int count) { Integer textlength1 = editText1.getText().length(); if (textlength1 >= 1) { editText2.requestFocus(); } } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence s,int count,int after) { // TODO Auto-generated method stub } }); editText2.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s,int count) { Integer textlength2 = editText1.getText().length(); if (textlength2 >= 1) { editText3.requestFocus(); } } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence s,int after) { // TODO Auto-generated method stub } });