Format string XXX is not a valid format string so it should not be passed to String.format
I just copied the code and it works well. so you may need to check some other place,Here are my suggestions.
- clean project
- check multi-language files
- or just use String.format just like others said
Set parameter formatted to true in resources:
<string name="some_text" formatted="true">
Use for String.format method. Parameter one: %s1
</string>
and use this way:
String.format(context.getString(R.string.some_text,"value 1"))
or this way:
context.getString(R.string.some_text,"value 1"))
Note:formatted flag should be set to true only for strings with placeholders
Try File -> Invalidate Caches / Restart...
, it fixed the problem for me.