I have this type of string:
<string name="temperature">%1$s °C</string>
How can i use integer in the place where variable should be instead of string? I've seen docs and found info only about string and double
I have this type of string:
<string name="temperature">%1$s °C</string>
How can i use integer in the place where variable should be instead of string? I've seen docs and found info only about string and double
use this in your XML file to convert integer into a string:
<string name="my_name">Text here num %1$d</string>
and then in your java file call the XML string resource like this:
getString(R.string.my_name), getResources().getInteger(R.integer.num1)));
that way the %d gets replaced by the integer you pass in the getString.