There is an EditText that behaves strangely, when typing, the characters in it are added not left to right, but from right to left (as if the text is typed in Arabic). I did not expose anywhere that the printing of symbols should be from the right to the left, what could be the problem?
Xml code:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="8dp" > <TextView android:id="@+id/tvWorkItemNumber" android:text="1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_marginRight="20dp" android:layout_marginLeft="7dp" android:textSize="@dimen/doc_title_font_size" /> <TextView android:id="@+id/tvClaimWorkName" android:layout_width="130dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginTop="10dp" android:layout_toRightOf="@+id/tvWorkItemNumber" android:textSize="@dimen/doc_title_font_size" android:text="test type 1"/> <TextView android:id="@+id/tvClaimPlan" android:layout_width="70dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:gravity="center" android:layout_marginRight="2dp" android:layout_marginTop="10dp" android:layout_toRightOf="@+id/tvClaimWorkName" android:textSize="@dimen/doc_title_font_size" android:text="2"/> <EditText android:id="@+id/etClaimFact" android:layout_width="200dp" android:layout_height="wrap_content" android:inputType="number" android:layout_marginLeft="2dp" android:layout_marginRight="1dp" android:layout_marginTop="10dp" android:gravity="center" android:layout_toRightOf="@+id/tvClaimPlan" android:textSize="@dimen/doc_title_font_size" /> </RelativeLayout> Screenshot, I type "1234567", and get "7654321":
TextWatcher Code:
etComment = (EditText) view.findViewById(R.id.etComment); etComment.setText(docWorkComment); etComment.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) { SQLiteDatabase db = DBH.getInstance(getActivity().getApplicationContext()).getWritableDatabase(); ContentValues cv = new ContentValues(); cv.put(DBH.DocK.DC.NOTE, String.valueOf(s)); db.update(DBH.DocK.TABLE_NAME, cv, "tabID=" + 1 + " and file_id=" + "'" + docId + "'", null); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } }); 
android:textDirection="anyRtl"try experimenting with this - Silento