Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public interface

Spannable

implements Spanned
android.text.Spannable
Known Indirect Subclasses

Class Overview

This is the interface for text to which markup objects can be attached and detached. Not all Spannable classes have mutable text; see Editable for that.

Summary

Nested Classes
class Spannable.Factory Factory used by TextView to create new Spannables. 
[Expand]
Inherited Constants
From interface android.text.Spanned
Public Methods
abstract void removeSpan ( Object what)
Remove the specified object from the range of text to which it was attached, if any.
abstract void setSpan ( Object what, int start, int end, int flags)
Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere.
[Expand]
Inherited Methods
From interface android.text.Spanned
From interface java.lang.CharSequence

Public Methods

public abstract void removeSpan ( Object what)

Added in API level 1

Remove the specified object from the range of text to which it was attached, if any. It is OK to remove an object that was never attached in the first place.

public abstract void setSpan ( Object what, int start, int end, int flags)

Added in API level 1

Attach the specified markup object to the range start…end of the text, or move the object to that range if it was already attached elsewhere. See Spanned for an explanation of what the flags mean. The object can be one that has meaning only within your application, or it can be one that the text system will use to affect text display or behavior. Some noteworthy ones are the subclasses of CharacterStyle and ParagraphStyle , and TextWatcher and SpanWatcher .