编辑strings.xml的时候

在行http://code.dd.com/rr?q=%rr.55

提示下面的错误

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

出现这个错误的原因主要是因为strings字串中包含百分号(%),

有几种方式解决

1.用两个百分号表示一个百分号即

http://code.dd.com/rr?q=%%rr.55

2.用转义符表示

http://code.dd.com/rr?q=\%rr.55

3.根据错误提示可知,如果字符串无需格式化,可在

http://code.dd.com/rr?q=%rr.550b1331709591d260c1c78e86d0c51c18.png

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐