Issue
I want to do the same thing I did here for a String
resource:
write(String.format(getString(R.string.night), "Scurcola"));
but for a String Array
, defined as follows:
<string-array name="goodMorning" formated="false">
<item>Good Morning folks!</item>
<item>Sun\'s out, guns out.</item>
<item>Careless vampires burn, and you wake up!</item>
<item>Can\'t find the moon. Oh it\'s probably morning then..</item>
<item>Darkness flees from %s, wake up!</item>
<item>Sunlight manifests, it\'s morning %s!</item>
<item>Stars went to bed, and %s wakes up!</item>
<item>Be beep. Be beep. %s wake up!</item>
</string-array>
How can I achieve this?
Solution
Every array item per se is actually a string.
Therefore, each item can be individually formatted.
I.e.:
write(String.format(getResources().getStringArray(R.array.goodMorning)[0], "Scurcola"));
Answered By - Phantômaxx
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.