やったことの記録
主にlinuxとかperlとか
プロフィール
HN:
隠居SE
性別:
非公開
最新記事
(12/12)
(09/28)
(09/26)
(09/25)
(09/21)
P R
ブログ内検索
忍者カウンター
2025/04/19 (Sat)
23:16:01
[PR]
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
2017/10/17 (Tue)
08:22:02
[Android] Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
<string name="format_summary">Games:%d Total:%d Avg:%.1f</string>
こんな値をリソースファイルに書いたら、
Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
と言うエラーが出た。
位置指定されていない複数の置換が指定されたフォーマットだよ。
もしかして、非フォーマットデータだった?
と言う意味らしい。
つまり、位置指定するか、アトリビュートを追加しろと言うことですね。
位置指定するならこう。
<string name="format_summary">Games:%1$d Total:%2$d Avg:%3$.1f</string>
アトリビュートを追加するならこう。
<string name="format_summary" formatted="false">Games:%d Total:%d Avg:%.1f</string>
#AndroidStudio #Resource
PR