On Tue, Oct 11, 2011 at 8:54 AM, saran vonteddu <saran.myw...@gmail.com> wrote: > I'm working on AlarmClock application. When ever my application > is killed due to low memory, > I want to retain some objects, so I want to store the > instance in SharedPreference so that I can retrieve > it whenever I needed.
That is not a typical pattern. > So I want to convert an Object into a String and > store that String in sharedpreference. That is a less-typical pattern. > I would like to store "AlarmManager" object , for that I'm using > ObjectSerializer.java to convert "AlarmManager" object to String. That is simply impossible. AlarmManager is a system service. You cannot persist it. If you are going to persist objects, persist your own objects, please. > How to resolve this issue. Atleast is there any way to store > AlarmManager object into Shared Preference so dat I can use the object wen > the > > application is killed. You do not need to persist the AlarmManager, which is good, because you cannot persist the AlarmManager. Simply call getSystemService() whenever you need the AlarmManager. - Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- 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