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