I'm using Parceler library for serialization in my project.
I have a RealmObject class like this:
@Parcel(implementations = {ARealmProxy.class}, value = Parcel.Serialization.BEAN, analyze = {A.class})
class A extends RealmObject {
public int id;
public int title;
}
I serialize an A object and put it into Intent like this:
Intent intent = new Intent(context, Main);
Bundle bundle = new Bundle();
A a = new A();
a.id = 10;
a.title = "title";
bundle.putParcelable("mykey", Parcels.wrap(a))
intent.putExtras(bundle);
context.startActivity(intent);
And I deserialize it like this:
Bundle bundle = getIntent().getExtras();
A a = Parcels.unwrap(bundle.getParcelable("mykey"));
// a's properties are null
And a's properties are null. How I can fix this?