You can have it implement Parcelable and implement the code to read/write its state.
On Thu, Oct 8, 2009 at 12:36 PM, Stefan <[email protected]> wrote: > > hi, > > thanks for your answers. thats really helps me for understanding. > > @Dianne > Atm, i only need orientation and keyboardHidden for rotation. But If > something other happened (like connecting an external keyboard), all > states are lost. So i don't want to use onConfigurationChanged, > because thats really hard, i know. But i have an instance of a class. > How can i save this state?? I want save many data: > > public void onSaveInstanceState(Bundle savedInstanceState) { > > super.onSaveInstanceState(savedInstanceState); //easy > savedInstanceState.putDouble("total_dist", > total_dist);//easy > savedInstanceState.putString("filename", filename);//easy > savedInstanceState.putInt("pict_nr", pict_nr);//easy > savedInstanceState.putBoolean("has_saved", has_saved);//easy > savedInstanceState.putBoolean("first", first);//easy > > savedInstanceState.put?????? ("sh", sh); // thats my class > instance > (sh = new SaveHelper(), i save my track- and waypoints and if i call > saveFile, the way- and trackpoints are saved as a gpx file on sd > card). I implement an own class for that, because my source code blow > up...) > > So how can i save all(!!!) important variables?? With the > onRetainNonConfigurationInstance(), i can only save one complex > data??? > And in a bundle, i can't save a Location variable and my class > instance?! > > Thanks, > Stefan > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

