Format string XXX is not a valid format string so it should not be passed to String.format

前端 未结 12 2142
没有蜡笔的小新
没有蜡笔的小新 2021-02-06 23:06

I have android app and this string in resources:

Select up to %1$d people!

Thi

12条回答
  •  隐瞒了意图╮
    2021-02-06 23:42

    Set parameter formatted to true in resources:

    
        Use for String.format method. Parameter one: %s1
    
    

    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

提交回复
热议问题