Hi James.
We try to implement
Parcelable interface. Something like this
https://developer.android.com/reference/android/os/Parcelable.html.
Example on stackoverflow are all around but for maps we cant find anything. HashMap use Serializable.
With primitive types everything is great but when we try to use map type we are in problem.
How to use parcable with primitive types:
https://gist.github.com/keyboardr/5563038And also how to put in bundle
https://gist.github.com/mmarcon/6660453Our solution for now look something like this:
@Override
public void writeToParcel(Parcel dest, int flags) {
ParcelableUtils.write(dest, getFrequency());
ParcelableUtils.write(dest, getStartDate());
//dest.writeMap(properties);
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
public RecurringMetaEntity createFromParcel(Parcel in) {
return new RecurringMetaEntity(in);
}
public RecurringMetaEntity[] newArray(int size) {
return new RecurringMetaEntity[size];
}
};
private RecurringMetaEntity(Parcel in){
super(Enums.DatabaseType.ORG);
setType(DocumentTypeCode.RECURRING_META);
setFrequency(ParcelableUtils.readString(in));
setStartDate(ParcelableUtils.readDate(in));
}
As you can see we are using primitive types from our properties and then send object to another activity ... when we found better solution I will write in this thread.
If someone is interested to see how it really works you can try android application https://play.google.com/store/apps/details?id=net.dzomba.termin3
Hello to all good people!