Prabhakar
Prabhakar

Reputation: 523

android - handle virtual keyboard enter key behaviour

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 ?

Upvotes: 0

Views: 1223

Answers (1)

leocadiotine
leocadiotine

Reputation: 3314

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!

Upvotes: 2

Related Questions