8

When I added many paragraphs between

<string name="bbb"> ...... </string>

it showed me following error.

[2014-12-22 14:54:55 - Inspiration] Her father rescued her from the heartless husband  and she was back her to the 
[2014-12-22 14:54:55 - Inspiration] G:\adt-bundle-windows-x86_64-20140702\workspace\Inspiration\res\layout\activity_women.xml:11: error: Error: No resource found that matches the given name (at 'text' with value '@string/Women1').
Kaushik
  • 6,150
  • 5
  • 39
  • 54
Lakshmi16
  • 93
  • 1
  • 1
  • 7

2 Answers2

7

Try this

 <string name="Your string name" > This is your string.

       This is the second line of your string.\n\n Third line of your string.</string>

This will result in the following on your TextView:

This is your string.

This is the second line of your string.

Third line of your string.
J.K
  • 2,290
  • 1
  • 18
  • 29
2

You can add the long string to /res/values/strings.xml, as it appears you've done.

You can separate paragraphs with the \n.

You will need to use Unicode codes for special characters like backslash, etc.. See this answer.

Yes, was just going to add what's in the other answer: The other trick is to use the CDATA trick:

<![CDATA[Foo Bar <a href="foo?id=%s">baz</a> is cool]]>

See this answer for more on that.

Community
  • 1
  • 1
JASON G PETERSON
  • 2,193
  • 1
  • 18
  • 19
  • \n\n will make line gap between characters. Works in my app. – JASON G PETERSON Dec 22 '14 at 09:59
  • I'm also not certain from the error, if you're correctly referencing the string resource to begin with. Put a single line in it with no special characters as a test to see if you're even getting the string back for starters. – JASON G PETERSON Dec 22 '14 at 10:02
  • string tag is working when i gave around one para or more. then when i added more, i got the error – Lakshmi16 Dec 22 '14 at 17:52