0

Using android:maxLength="4" attribute, I am able to restrict the input into 4 digits. But still the input popup in firetv stick shows spaces for 5 digits. Customer is getting confused because of these. Any solution would be appreciated.

enter image description here

I declared the EditText in layout xml as follows.

<EditText
            android:id="@+id/pin_edit_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="numberPassword"
            android:background="@drawable/ls_edit_text_bg"
            android:layout_marginTop="20dp"
            android:textColor="@color/white"
            android:textSize="30sp"
            android:padding="10dp"
            android:maxLength="4"
            />
Prince Francis
  • 2,995
  • 1
  • 14
  • 22
  • 2
    android:ems="4" ? Fix the width to be notationally 4 "M" wide as maxLength controls the number of input characters, not the size of the view. Note depending on the font you still might get more than 4 characters unless using a Monospaced font. – Andrew Feb 15 '22 at 15:03
  • Hi, have you found a solution for this? – denysowova Mar 07 '22 at 12:35

0 Answers0