I decided to use it below.
In your xml layout for edit text field add this ->
android:textDirection="anyRtl"
Here "editText" is your text edit field. those.
EditText editText = (EditText) findViewById(R.id.edit_text);
Then programmatically add a text observer for this edit text.
editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { editText.setSelection(s.length());
It worked for me!
source share