3

I have Arabic text inside a TextView.

I have added \n character to the String but it's not producing expected results.

Below is the String:

ك بتوفير مزيد من الأمان والراحة لكلا الطرفين المؤجر و المستأجر، بناءً على احتياجاتهم، وعليه أنشأت الشركة تطبيقًا يُطلق عليه تطبيق إن ، وهو ما جعل تحصيل

تسعى شركة أبيليتيز لإدارة العقارات (ذ. م. م) جاهدةً لتطوير وتحسين هذا الجانب من إدارة العقارات

I want last line of Arabic text on a new line.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Anwar Shaikh
  • 104
  • 3
  • 5

5 Answers5

3

Write n\ instead of \n. It will work fine

iknow
  • 8,358
  • 12
  • 41
  • 68
Ibrahim
  • 149
  • 4
0

Use System.getProperty("line.separator") instead of \n or whatever. As is it is different in Andorid .

Please Refer This : New Line character \n not displaying properly in textView Android

Community
  • 1
  • 1
Tilak Madichetti
  • 4,110
  • 5
  • 34
  • 52
0

You can define it in strings.xml file like this :

<string name="arabic_text">ك بتوفير مزيد من الأمان والراحة لكلا الطرفين المؤجر و المستأجر، بناءً على احتياجاتهم، وعليه أنشأت الشركة تطبيقًا يُطلق عليه تطبيق إن ، وهو ما جعل تحصيل \n تسعى شركة أبيليتيز لإدارة العقارات (ذ. م. م) جاهدةً لتطوير وتحسين هذا الجانب من إدارة العقارات</string>

Then use it in textview : android:text="@string/arabic_text"

MUHAMMED IQBAL PA
  • 3,152
  • 2
  • 15
  • 23
0

Open the "string.xml (ar)" and put \n and there you go. Do not put it in the editor

Shogun Nassar
  • 606
  • 7
  • 16
-2

Try:

"String One" + "\n" + "String Two";
Adarsh
  • 270
  • 1
  • 3
  • 16