I did read your site posts before deciding how to saving data when
rotating, but the problem is onRetain....() isn't called, for example,
when you set the emulator to destroy activities immediately and then
press 'Home'. OnSave....() on the other hand *is* called. Because of
this, I've decided to save the text in onSave...() instead, but I
can't preserve formatting.

On Dec 30, 12:34 am, Mark Murphy <mmur...@commonsware.com> wrote:
> 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, 
> 2009http://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to