I've worked quite a bit with the AlarmManager and can probably help direct 
you to a different solution. Since what you are asking for is not really 
possible (as noted by Mr. Murphy), I'm sure there are other ways of 
retaining the data that you need.

What are you trying to accomplish by saving the AlarmManager?

Steven
Studio LFP
http://www.studio-lfp.com


On Tuesday, October 11, 2011 7:54:32 AM UTC-5, saran wrote:
>
> Hi all, 
>  
>           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. So I want to convert an Object into a String and 
>  store that String in sharedpreference. 
> I would like to store "*AlarmManager*" object , for that I'm using 
> ObjectSerializer.java to convert "AlarmManager" object to String. 
>  
>       Below is the code I'm using............
>  
>  
> AlarmManager alarmManager = (AlarmManager) getSystemService(
> *ALARM_SERVICE*); 
>
> String alarmString = ObjectSerializer.*serialize*(alarmManager);
>
> AlarmManager *alarmMgr* = ObjectSerializer.*deserialize*(alarmString);
>
> alarmManager.set(AlarmManager.
> *RTC_WAKEUP*, System.*currentTimeMillis*() 
>
> + (i * 1000), pendingIntent);
>
> Toast.*makeText*(
> *this*, "Alarm set in " + i + " seconds", 
>
> Toast.
> *LENGTH_LONG*).show(); 
>
> I'm getting the following error.
>
> <<<<<<<<<<<10-11 18:10:49.015: INFO/System.out(13048): 
> ******Exception*****IOE*********java.io.NotSerializableException: 
> com.lge.ObjectSerialize.PersistentTime>>>>>>>>>>>
>
> 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. 
>
>         Any help in this regard would be highly appreciated.
>
>  
>
> thanks in advance, 
>
> Saran
>
>
>  
>
>  
>

-- 
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