Many times we have faced problems like we want to disable special and space character in edit text.
So to prevent this we have a property called "android:digits", we have to list the characters which we want to allow in edit text.
We have to use it like this :-
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="ABCDEFGHIJKLMNOPQRSTUVWXYZ012345"/>
So in the above edit text user can only enter capital alphabets and 0 to 5 numerics only rest others characters will not able to enter into the edit text. So in this way you can use this property to disable desired characters in edit text.
For any help, please feel free to write in comments.
0 Comment(s)