Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6008095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:46:34+00:00 2026-05-23T01:46:34+00:00

I am setting text in TextView from string resource. Normally, Hebrew works in Right-To-Left

  • 0

I am setting text in TextView from string resource. Normally, Hebrew works in Right-To-Left format. When I set a text, it sets the text Right-To-Left format in LG, Samsung, Sony Phone but in HTC it does not work. It works in Left-To-Right format in HTC. Even I set Gravity to the TextView in Java file.

Text in TextView should be span according to the screen size. For example if it is 320 x 480 then it display in 4 lines but if it is Galaxy Tab then there may be 2 lines.

Here is my Code snippet:

In Java:

private TextView mVersionInfo, mVersionDescriptionOne, mVersionDescriptionTwo, mVersionDescriptionThree;

mVersionInfo = (TextView)findViewById(R.id.VersionInfo);
mVersionDescriptionOne = (TextView)findViewById(R.id.VersionDesc1);
mVersionDescriptionTwo = (TextView)findViewById(R.id.VersionDesc2);
mVersionDescriptionThree = (TextView)findViewById(R.id.VersionDesc3);

mVersionDescriptionOne.setGravity(Gravity.RIGHT);
mVersionDescriptionTwo.setGravity(Gravity.RIGHT);
mVersionDescriptionThree.setGravity(Gravity.RIGHT);

in XML:

<TextView android:id="@+id/VersionDesc1"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:text="@string/versiondesc1" android:textColor="#000000"
        android:layout_marginTop="5dip" android:gravity="right"
        android:layout_alignParentRight="true" android:layout_marginRight="10dip"
        android:layout_below="@+id/Share" android:textSize="13sp"
        android:layout_alignRight="@+id/Body" />
    <TextView android:id="@+id/VersionDesc2"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:text="@string/versiondesc2" android:textColor="#000000"
        android:layout_alignParentRight="true" android:layout_marginRight="10dip"
        android:layout_below="@+id/VersionDesc1" android:textSize="13sp"
        android:layout_marginTop="5dip" android:gravity="right"
        android:layout_alignRight="@+id/Body" />
    <TextView android:id="@+id/VersionDesc3"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:text="@string/versiondesc3" android:textColor="#000000"
        android:layout_alignParentRight="true" android:layout_marginRight="10dip"
        android:layout_below="@+id/VersionDesc2" android:textSize="13sp"
        android:layout_marginTop="5dip" android:gravity="right"
        android:layout_alignRight="@+id/Body" />

In String Resource:

<string name="versiondesc1">האפליקציה מתחברת לאתר הספק הסלולרי כדי להציג את מצב החשבון. לעיתים, כשאתר הספק איננו עובד תקין לא יהיה ניתן לקבל מידע. באם אתר הספק ישתנה האפליקציה עלולה להפסיק לעבוד. במצב כזה האפליקציה תחזור לעבודה תקינה מיד לאחר שאנו נתאים את שרת התוכנה שלנו לשינויים.</string>
<string name="versiondesc2">הערה: אנחנו לא מייצגים את חברות הסלולר ולא נמצאים איתן בקשר מסוג כלשהו!</string>
<string name="versiondesc3">אם נתקלת בבעיה, השתמש/י בכפתור יצירת קשר על מנת שנוכל לפתור אותה. נשמח לקבל כל משוב על האפליקציה.</string>

What is wrong with my code?

Anybody who has worked with another language, Please guide me here.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:46:35+00:00Added an answer on May 23, 2026 at 1:46 am

    Gravity will only affect alignment and will not set base direction for the text. That it works on some devices and not others may be a font issue, or perhaps an OS version issue. Try adding a RIGHT-TO-LEFT MARK character (\u200F) at the start of your text. This might help the display on an HTC and will not hurt anything on devices where it is already working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I am setting the Text property of a Form from a non-UI thread,
I'm setting up my site to receive info from people via text message. The
if I have set text in textview in such way, which is not problem:
In my application I need to set dynamic text to my textview so I
I'm creating a GroupBox at runtime and setting its Text property. Usually, the text
I am setting up an alert with a text field in it so players
I am having trouble setting my ContentProperty to Text. The error I am given
This is the css for setting the color for h1 text that is linked:
In a .aspx web page, by setting a textbox's text property by code in
I am reading a string from an xml file stored on the sdcard that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.