I'm trying to write a Notification object to a File. The best way I could find was to write the object to a parcel, marshall that parcel to get a byte[] and then write it to a file.
Parcel notif = Parcel.obtain();
notification.writeToParcel(notif, 0);
byte[] notifArray = notif.marshall();
I get a Runtime exception when I try to marshall the parcel though: "Tried to marshall a Parcel that contained Binder objects."
Is there a better way of writing Notification objects to file? Else, how do I get this approach to work?