Is it possible to put variables inside string-resources? And if yes - how do i use them.
What i need is the following:
<string name="next_x_results">Next %X results</string>
and put an int in place of the %X.
See Question&Answers more detail:osIs it possible to put variables inside string-resources? And if yes - how do i use them.
What i need is the following:
<string name="next_x_results">Next %X results</string>
and put an int in place of the %X.
See Question&Answers more detail:os<string name="meatShootingMessage">You shot %1$d pounds of meat!</string>
int numPoundsMeat = 123;
String strMeatFormat = getResources().getString(R.string.meatShootingMessage, numPoundsMeat);
Example taken from here