Curiously want to know what is the purpose of Spannable
in android. Isn't char array sufficient?
Asked
Active
Viewed 2,835 times
5

SmileyChris
- 10,578
- 4
- 40
- 33

DraD
- 211
- 1
- 3
- 7
1 Answers
9
A Spannable
allows to attach formatting information like bold, italic, ... to sub-sequences ("spans", thus the name) of the characters. It can be used whenever you want to represent "rich text".
The Html
class provides an easy way to construct such text, for example:
Html.fromHtml("Text with <b>bold</b> and <em>italic</em>.")

Henry
- 42,982
- 7
- 68
- 84
-
exactly .. my question was any special case where we should use spannable and nothing else will work – DraD Feb 19 '13 at 08:41