3

I am trying to create a Dashed input field for numbers in android layout, such as " _ _ _ _ " where I can add 4 numbers and get them in my main activity. I have searched a lot but not getting any better solution.

Arnaud
  • 7,259
  • 10
  • 50
  • 71
Muhammad Usman
  • 795
  • 7
  • 19

2 Answers2

4

Use this library to achieve your objective. https://github.com/glomadrian/material-code-input

Satyam Anand
  • 377
  • 1
  • 8
2

Create EditText for 4 dashes and implement OnTextChanged() for every EditText to quickly jump to other input. Make sure the EditText has input type as number and can only allow a single digit. You can create such with this concept.

Sanjog Shrestha
  • 417
  • 9
  • 16