How to restrict the EditText to accept only alphanumeric characters February 7, 2023 by Tarik In the XML, add this: android:digits="abcdefghijklmnopqrstuvwxyz1234567890 "