Format EditText view for phone numbers

后端 未结 8 1811
既然无缘
既然无缘 2020-12-28 20:49

I have an EditText view and I want it to format the user\'s input into the phone number format. For example, when the user types in 1234567890, the EditText view should dyna

8条回答
  •  孤独总比滥情好
    2020-12-28 21:15

    In your Java code you can use

    yourEditText.setInputType(InputTytpe.TYPE_CLASS_PHONE)

    or in your xml

    android:inputType="phone"

    Java

    XML

提交回复
热议问题