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

前端 未结 12 2146
没有蜡笔的小新
没有蜡笔的小新 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:44

    For the formatting of the string to be correct:

    String.format(Locale.ENGLISH, itemView.context.getString(R.string.XXX), "%17") 
    

    Also the special characters do not have to interfere with the injection of parameters. For that, take into account the exhaust outlets for special characters

    From: % %1$s

    To: %1$s

    Finally XXX is "%17"

    Good Luck.

    Source

提交回复
热议问题