3

There is an editText with textWatcher applied. As you see in the below Gif, I cannot delete the numbers from end of the EditText, but first. When locale is english everything works fine, but not in arabic language.

enter image description here

   <EditText
        android:id="@+id/destination"
        android:inputType="number"
        android:maxLength="19"
        android:digits="0123456789-"
        android:hint="@string/to"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textSize="16sp"
        android:imeOptions="actionDone"
 />
Davoud
  • 2,576
  • 1
  • 32
  • 53

1 Answers1

0

Isn't arabic read from right to left? So left is actually the end.

Ok, try adding android:inputType="number"

andrei
  • 2,934
  • 2
  • 23
  • 36
  • If it was an arabic sentence, you were right, but numbers are the same as english language. I think I have to set a layout direction to this field. – Davoud Nov 20 '17 at 14:09
  • @Patzu I didn't know numbers are the same. I edited my answer, I think you need to set the inputType on the EditText – andrei Nov 20 '17 at 14:12
  • look at the third line of xml that I added, it's already there. – Davoud Nov 20 '17 at 14:31