1、string.xml中的值含有百分号%,导致整个报错:
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
- error: Unexpected end tag string
有两个办法可供选择
1.用%%来表示1个%,和转意符号 \ 的用法相同 ,但是使用
contex.getString(R.string.xx);
读取出来的值带有两个%,再使用String.format()无法达到预期的效果。
有两个办法可供选择
1.用%%来表示1个%,和转意符号 \ 的用法相同
2.如果你的字符串不需要格式化,可以在你的%test% 即可。
PS:使用第二种方法解决