getQuantityString not replacing the format with the value

From the Android docs:

When using the getQuantityString() method, you need to pass the
count twice if your string includes string formatting with a number.
For example, for the string %d songs found, the first count
parameter selects the appropriate plural string and the second count
parameter is inserted into the %d placeholder. If your plural
strings do not include string formatting, you don’t need to pass the
third parameter to getQuantityString.

ie res.getQuantityString(R.plurals.numberOfSongsAvailable, count, count);

Leave a Comment