ADT が Strings.xml にエラーを表示する 質問する

ADT が Strings.xml にエラーを表示する 質問する

Gingerbreadがリリースされた後、ADTを最新バージョンにアップデートしました。そして今

<string name="date_format">%d:%d %s</string>

次のエラーが表示されます

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

以前の ADT バージョンは正常に動作していました。何か間違っているのでしょうか? フォーマット指定子が 1 つ以上ある場合は常にこのエラーが発生します。

ベストアンサー1

または、次のように、% フォーマット指定子を変更して引数インデックスを使用することもできます。

<string name="date_format">%1$d:%2$d %3$s</string>

Formatterクラスの詳細については、Android リファレンスドキュメント

おすすめ記事