Android How can I Convert a String to a Editable

As you probably found out, Editable is an interface so you cannot call new Editable().
However an Editable is nothing more than a String with Spannables, so use SpannableStringBuilder:

Editable editable = new SpannableStringBuilder("Pass a string here");

If you only want to change the Spannables, never the text itself, you can use a basic SpannableString.

Leave a Comment