Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

string.xml Multiple substitutions specified if using % follow by string two times

Tags:

android

Why is this working?

<string name="quantity_geoFormat">"%s"</string>

And this not?

<string name="quantity_geoFormat">"%s %s"</string>

For the second I am getting this error: Multiple substitutions specified in non-positional format;

like image 501
JPLauber Avatar asked Mar 17 '15 14:03

JPLauber


1 Answers

You need to use the positional substitution format, which looks like this: %1$s.

Thus your second string resource should look like this:

<string name="quantity_geoFormat">"%1$s %2$s"</string>
like image 166
Bryan Herbst Avatar answered Sep 22 '22 00:09

Bryan Herbst