How to format long text in strings.xml?

When I have a TextView with long text, I usually have to leave it on one line, which is subsequently very difficult to edit. If I use any formatting, for example, in this image

Then I get an error message.

enter image description here

I would like to know how to format such long text into multi-line text without errors?

EDIT

I was not accurate in my Q. It seems that this can be resolved in Eclipse. The problem is IntelliJ IDEA and its formatting command Ctrl + Alt + L, which is not passed by the compiler in the strings.xml file. Snapshots from this IDE.

+4
source share
2 answers

The problem with formatting code that violates the XML text is known and will be fixed in an upcoming version if IJ. At least in the case shown here: http://youtrack.jetbrains.net/issue/IDEA-69506?projectKey=IDEA

+2
source

There was the same problem a few weeks ago and found that there is no good way to do this. If you want the output text in your application to have multiple lines, you can simply insert "\ n" as many times as you want, but if you only talk about it in the editor, Eclipse does not support this natively.

However, I found this: http://ahtik.com/blog/projects/eclipse-word-wrap/

A good project, left over from Googleโ€™s summer code in the summer a few years ago, makes a visual word wrap, so I donโ€™t think it will affect the compilation process, which should prevent these errors.

+2
source

All Articles