Reputation: 335
I have below string resources in my android studio project.
<string name="not_registered">Haven't registered yet?</string>
I set the string into TextView with following code:-
android:text="@string/not_registered"
It show proper text in xml preview window as expected:-
But when i run the project then it doesn't show the text after special char " ' ". It only show
I am not able to understand why it is not showing full string.
Upvotes: 0
Views: 987
Reputation: 2458
As per Android Documentation. spacial character Single quote (')
cab be used any way of the following:
In your case You can use as follows
<string name="not_registered">Haven\'t registered yet?</string>
<string name="not_registered">"Haven't registered yet?"</string>
both way will work.
Upvotes: 2
Reputation:
All of the below code look fine in preview:
<string name="not_registered">Haven't registered yet?</string>
<string name="not_registered">Haven't registered yet?</string>
<string name="not_registered">Haven\'t registered yet?</string>
but only the 3d works!!!
Upvotes: 1
Reputation: 13288
<string name="not_registered">Haven\'t registered yet?</string>
Upvotes: 1
Reputation: 2161
Try like this:
<string name="not_registered">Haven\'t registered yet?</string>
it's working
Upvotes: 1
Reputation: 973
Use <string name="not_registered">Haven\'t registered yet?</string>
instead of
<string name="not_registered">Haven't registered yet?</string>
Upvotes: 3
Reputation: 200
First, change into your string resource.
<string name="not_registered">Haven\'t registered yet?</string>
And set the string into TextView with following code:-
android:text="@string/not_registered"
Upvotes: 4