Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText bug: content duplicates after pressing a restricted character

I have an EditText with restricted characters. I allow digits only as

A strange thing appears on a Galaxy S4. It didn't appear a HTC Desire HD, HTC Desire X and a ZTE Blade.

  1. I type dddsss
  2. I type a swedish character like å.
  3. It's not appearing as it is not an allowed character, so the content is still dddsss
  4. I type a character, e.g. u
  5. The content of the EditText becomes dddsssdddsssu
  6. I type another character, e.g. t and the content becomes dddsssdddsssudddsssut

It sometimes happens when I press the backspace as well, so it must be a button press issue.

I added android:inputType="textNoSuggestions" but it didn't help.

<EditText
      android:id="@+id/comment_et"
      android:layout_width="0dp"
      android:layout_height="45dp"
      android:layout_marginRight="5dp"
      android:layout_weight="1"
      android:paddingLeft="5dp"
      android:paddingRight="5dp"
      android:background="@drawable/idea_edittext"
      android:digits="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ,0,1,2,3,4,5,6,7,8,9,*,!,@,#,$,%,^,(,),_,+,-,[,],{,},:,;,&apos;,|,\,.,/,ß,?,~,="
      android:inputType="textCapSentences|textNoSuggestions"
      android:textSize="16dp" />

Has anyone experienced this?

like image 578
erdomester Avatar asked Apr 26 '14 12:04

erdomester


1 Answers

I have same problem and solved with changing EditText's inputtype to:

android:inputType="text|textNoSuggestions"

I don't know if it's a proper solution but it's ok for me.

like image 153
savepopulation Avatar answered Oct 05 '22 04:10

savepopulation