2

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
  • 26,923
  • 21
  • 73
  • 125
Anwar Shaikh
  • 69
  • 3
  • 5

5 Answers5

3

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

iknow
  • 6,507
  • 10
  • 30
  • 55
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 Maddy
  • 3,505
  • 2
  • 32
  • 49
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
  • 2,293
  • 2
  • 14
  • 18
0

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

Shogun Nassar
  • 512
  • 4
  • 15
-2

Try:

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