1
<string name="weather_fragment_temp_str">%s°~%s°</string>

Multiple annotations found at this line:
    - error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" 
     attribute?
    - error: Unexpected end tag string
see2851
  • 627
  • 1
  • 9
  • 13

1 Answers1

2

The reason for this is that you're specifying that you want to substitute multiple values into this string, however you need to specify where each argument should go. The reason for this is that different languages are structured differently.

You can use string substitution with multiple substitutions like so:

<string name="weather_fragment_temp_str">%1$s°~%2$s°</string>

This way, other languages can have the replacements in different locations. For example you may want 16°~20° in English, and 20°~16° in Japanese - in your Japanese strings.xml you'd just do %2$s°~%1$s°, and then your code stays the same (that's an entirely contrived example, of course).

Adam S
  • 16,144
  • 6
  • 54
  • 81
  • Of course, if you're actually just trying to display a percent symbol, then this is [a duplicate](http://stackoverflow.com/questions/4414389/android-xml-percent-symbol?rq=1). – Adam S Jan 06 '14 at 03:26