I have a string thats HTML formatted and saved as a SpannableString. On a config change etc onSaveInstanceState is called prior and then onRestoreInstanceState to restore states etc. How can i save and restore a spannableString ... all i see is methods to save a string but not spannable items:
protected void onSaveInstanceState(final Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString("mystring", aString);
}
Looks like i have to take advantage of two methods to ge this done...
public static String toHtml (Spanned text)
and
public static Spanned fromHtml (String source)
so call toHTML when saving it as a string and then fromHTML when restoring it.