That resource string could be used anywhere. How would the compiler know what $name is referring to?
In this case, I think you should use: MessageFormat.format(getString(R.string.download_all), name)
or String.format(getString(R.string.download_all), name)
I am sorry, I should have mentioned that you need to change your definition of the string too.
If you are going to use MessageFormat, you need to replace $variableName with {0}
If you are going to use String.format, you need to replace $variableName with %1$s
Both of them indicate that it should be replaced by the first argument of the format method.