I'd created EditText with following.
<EditText
android:id="@+id/et_regis_num"
android:maxLines="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
android:hint="@string/txt_reg_num"
android:inputType="textCapCharacters"
android:maxLength="10" />
in this edittext I don't want to press SPACE key but when I'm pressing SPACE key it's working as BACKSPACE key. means it's deleting one character in each twice press.
android:maxLength="10"
andandroid:digits="1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"
. What is the behavior if you try pressing any key other than space after the 10-character limit? Which devices have you tried this on? – Hegyeraandroid:digits
attribute. – HegyeraEditText
. Other people seem to have encountered this as well, with no solution. Your best bet seems to removeandroid:digits
from the xml and handle the input programmatically with a regex or something. Also, this only happens with the soft keyboard. With the hard keyboard, theEditText
doesn't register the space key. – Hegyera