I have 2 EditText's on my Activity and set the maxLength
to 5.
Now I want to set the focus to editText2
, if the length of 5 is reached in editView1
...
I tried it with:
editView1.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if(editView1.getText().length() == 5)
editView2.requestFocus();
return false;
}
});
But it won't work..