praj
praj

Reputation: 859

How to call indian language from string file?

I am triying to add Indian languages. It is working fine when I used setText.

 name=(EditText)loginView.findViewById(R.id.edittext_driver_lname);
 name.setText("fMþ @ûCU");

if I add these same text string file and try to call then it is not getting proper value.

<string name="frg_lgn_btn_go_online">fMþ @ûCU</string>

may I know what is the reason for this. I am more preferring calling string file rather than adding setText. How to solve this issue.

<EditText
            android:id="@+id/edittext_driver_lname"
            android:layout_width="@dimen/login_edittext_width"
            android:layout_height="wrap_content"
            android:layout_below="@+id/edittext_driver_fname"
            android:layout_centerHorizontal="true"
            android:layout_margin="@dimen/min_margin_elements"
            android:text="@string/frg_lgn_btn_go_online"
            android:inputType="text" />

i need to use xml set text rather than setText in java.

Upvotes: 0

Views: 79

Answers (1)

Sunil Sunny
Sunil Sunny

Reputation: 3994

You need to escape the characters when using in xml.

Try this fM&#254; @&#251;CU and see what is the output. You can easily get the escaped strings by pasting it here

http://www.freeformatter.com/xml-escape.html .Hope this helps.

Upvotes: 1

Related Questions