Al wrote:
> My app uses colour on some of the strings it writes to the TextView.
> The problem I'm having is when I open/close the keyboard, I'm forced
> to save the coloured data as Strings, which means it loses formatting.
> The Bundle class doesn't support saving Objects so I've tried writing
> it to a Parcel and then storing it in a Bundle. But then it needs a
> ClassLoader to read the data back, and I'm not sure I need to pass to
> it. The TextView text is a mix of spannableStrings and plain 'ol
> String. Any pointers on saving the formatting between open/close
> keyboard cycle is appreciated.

Don't use the Bundle, at least for rotations.

There are plenty of alternative approaches, such as using
onRetainNonConfigurationInstance(). I have a five-post series on
AndroidGuys that covers this area:

http://androidguys.com/?s=rotational+forces

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to