Reputation: 6591
I have an EditText
which when some text entered the virtual keyboard appears and when I press enter I can't get focus in my second EditText
, but some times it works.
Anybody please help.
edittext.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ENTER)// key code for virtual keyboard next
{
System.out.println("Event catched>>>>>>>>>>>>>>");
edittext.requestFocus();
}
return false;
}
});
Upvotes: 2
Views: 1234
Reputation: 93123
You shouldn't do that from your code.
You need to setup the android:imeOptions correctly in your EditText
.
Upvotes: 1