Reputation: 479
In my Android project I want to put certain condition on edittext that it can accepts only following list of values :-
!#$%&'()*+,-./:;<>=?@[]\_`{}|~^"*abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
and not the the values like shown in keyboard such as ©,® :-
Kindly provide me solution.
Upvotes: 0
Views: 79
Reputation: 4717
use this in the XML file.
<EditText
android:inputType="text"
android:digits="!#$%&'()*+,-./:;<>=?@[]\_`{}|~^"*abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
android:hint="Only letters, digits, _ and - allowed"
/>
Upvotes: 1