android - handle virtual keyboard enter key behaviour

1.2k Views Asked by At

I have five edittext in my layout. by default when i click on any of the edittext the virtual keyboard shows like following

enter image description here

Is it possible to modify the behavior of enter key ? I want when the key pressed the focus should be transferred to next edit text. Keyboard should look like

notice the change in enter key and also suggestions are disabled

notice the change in enter key and also suggestions are disabled. Is there any way to achieve it ?

1

There are 1 best solutions below

0
On BEST ANSWER

To disable text suggestions, add the following parameter to your EditText:

<EditText
    android:inputType="textNoSuggestions"
    (…)
/>

And to go to the next field upon pressing "enter" add the ID of the next field on the following parameter:

<EditText
    android:nextFocusForward="@+id/nextEditTextId"
    (…)
/>

Details can be found here.

Hope it helps!