Android:Multiple substitutions specified in non-positional format

created at 09-02-2021 views: 161

cause of the error

First I defined some strings in the string.xml file

<string name = "upgrade_time"> 驱动板:%s\t\t信号版:%s</string>

The error message means multiple replacements specified in a non-positional format. The error message mentions setting formatted="false", so I changed the above code to the following and the error will not be reported.


I checked some blog posts and tried it for myself. There are these ways to solve the above error:

  • Add formatted="false" attribute to the string
  • Use %% to represent %
created at:09-02-2021
edited at: 09-02-2021: