解决strings.xml格式化占位符错误:Multiple substitutions specified in non-positional format

使用strings.xml进行格式化占位符时报错:

Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?

检查后发现是格式化字符串中包含多个占位符导致

解决案例:

<string name="test">HomePage: %1$s, Author: %2$s</string>

<string name="order_total_hint">Total %1$d products(including shipping %2$s%3$.2f)</string>
上一篇 Android Cannot call this method while RecyclerView is computing a layout or scrolling
下一篇 GreenDao insert 解决 PRIMARY KEY must be unique
目录
文章列表
1 Java volatile详解
Java volatile详解
2
Tomcat修改webapps目录及配置虚拟主机实现域名访问
Tomcat修改webapps目录及配置虚拟主机实现域名访问
3
matplotlib之plt.figure
matplotlib之plt.figure
4
React+Redux基本使用流程
React+Redux基本使用流程
5
Spring Boot 2.0 之优雅停机
Spring Boot 2.0 之优雅停机
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。