How can is use string formatting on the
<string-array><item>
- resource in Android?
Should i do it like in the following example(and how should i do it if yes)...
<string-array name="notification-msgs">
<item>%s sent you a message.</item>
<item>%s answered to your Story</item>
</string-array>
or what kind of technique is common to use in this case?
I only know how to Format string resources.(with getString(R.id.mystring,replacevalue)
)
Thanks for any help!
EDIT:
Unfortunately there is no direct way provided by Android to achieve this. Best you can do is:
String.format(getResources().getStringArray(R.array.notification-msgs)[0], "Someone")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With