'How to create a group of EditText with aflow between them

I have to create a group of EditText s that each can contains 1 character of a pin code with auto flow between like in the following image - enter image description here

when user tapping the the keyboard, the application moves to the next EditText with out any Intervention of the user. How can it be done?



Solution 1:[1]

It's called PinView, here is a link for PinView.

They have made custom keyboard too. Including back button, and verification code, make changes as per your requirement. It's very good and simple tutorial to achieve this important functionality.

Solution 2:[2]

Make an array of edit text:

private EditText pinInput[] = new EditText[4];

Then add each EditText in array:

pinInput[0] = (EditText) findViewById(R.id.first);
...

Then implement the functionality by using onTextChanged and onFucusChanged listeners

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chitrang
Solution 2 Community