I received an error message from my customers about my Android application on Lenovo devices. I noticed that when I set the application language to RTL, such as Persian or change the Android OS language to Persian, the method setTex() EditTexteither Textviewinserts two additional characters at the beginning and at the end of the original line. For instance:
String myString1 = "original string";
int length1 = myString1.length();
myEditText.setText(myString1);
String myString2 = myEditText.getText().toString();
int length2 = myString2.length();
This issue only occurs on Lenovo devices. The method setText()adds LEFT-TO-RIGHT OVERRIDE (U+202D)at the beginning and POP DIRECTIONAL FORMATTING (U+202C)at the end of my line in RTL mode. This causes big problems in my application. I have many methods setText(). Is there a short solution to solve this problem?
Device Information: Lenovo Tablet TB-8504X, Android 7.1.1
Update:
Problem with Android OS? Can I find any fix for the device?
source
share