I have an array of strings in which the %
symbol is used. Proper format for using the %
is %
. When I have a string in that array with multiple %
it gives me this error.
Multiple annotations found at this
line:
- error: Multiple substitutions specified in non-positional format;
did you mean to add the formatted="false" attribute?
- error: Found tag </item> where </string-array> is expected
In your strings.xml file you can use any Unicode sign you want.
For example, the Unicode number for percent sign is 0025:
You can see a comprehensive list of Unicode signs here
Per google official documentation, use %1$s and %2$s http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling
Hello, %1$s! You have %2$d new messages.