Issue
Is there a way to extract a Spannable[] stuff
from string resource? Basically something similar to
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="planets_array">
<item>Welcome to <b>Mercury</b></item>
<item>Welcome to <b>Venus</b></item>
<item>Welcome to <b>Earth</b></item>
<item>Welcome to <b>Mars</b></item>
</string-array>
</resources>
Then I would extract the array into
Resources res = getResources();
Spannable[] planets = res.getStringArray(R.array.planets_array);
But right now eclipse is telling me to change Spannable[]
to String[]
.
Solution
use getTextArray, it returns CharSequence[] instead of String[] which preserves attached spans
Answered By - pskink
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.