# Spannable.Factory

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Factory

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/text/Spannable.Factory "View this page in Java")  

```
open class Factory
```

|---|------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                   ||
| ↳ | [android.text.Spannable.Factory](https://developer.android.com/reference/kotlin/android/text/Spannable.Factory#) |

Factory used by TextView to create new[Spannables](https://developer.android.com/reference/kotlin/android/text/Spannable). You can subclass it to provide something other than[SpannableString](https://developer.android.com/reference/kotlin/android/text/SpannableString).

## Summary

|                                               Public constructors                                                ||
|---------------------------------------------------------------------------------------------------------------|---|
| [Factory](https://developer.android.com/reference/kotlin/android/text/Spannable.Factory#Factory())`()` <br /> |

|                                                                                                                                                                                                        Public methods                                                                                                                                                                                                        ||
|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| openstatic[Spannable.Factory](https://developer.android.com/reference/kotlin/android/text/Spannable.Factory#)! | [getInstance](https://developer.android.com/reference/kotlin/android/text/Spannable.Factory#getInstance())`()` Returns the standard Spannable Factory.                                                                                                                                                       |
| open[Spannable](https://developer.android.com/reference/kotlin/android/text/Spannable)!                        | [newSpannable](https://developer.android.com/reference/kotlin/android/text/Spannable.Factory#newSpannable(kotlin.CharSequence))`(`source:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`)` Returns a new SpannableString from the specified CharSequence. |

## Public constructors

### Factory

```
Factory()
```

## Public methods

### getInstance

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open static fun getInstance(): Spannable.Factory!
```

Returns the standard Spannable Factory.  

### newSpannable

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun newSpannable(source: CharSequence!): Spannable!
```

Returns a new SpannableString from the specified CharSequence. You can override this to provide a different kind of Spannable.