I need to implement an EditText
on Android which accepts only a specific range of characters, which are: "S,A,Q,W,R,B,C,D,E,U".
The em is simply the font size. In an element with a 2in font, 1em thus means 2in. Expressing sizes, such as margins and paddings, in em means they are related to the font size, and if the user has a big font (e.g., on a big screen) or a small font (e.g., on a handheld device), the sizes will be in proportion.
EditText is used for user input. TextView is used to display text and is not editable by the user. TextView can be updated programatically at any time.
What about using these two attributes in your EditText
android:maxLength="1"
android:digits = "SABCDEU"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With