Search code examples
javaandroidrealmparceler

Can I use Realm + Parceler with public attribute ( without getter / setter)?


It seems that if I don't generate the getters and setters for my RealmObject and send it to another activity using Parceler, all the attributes are reset to their default value.

Is there a way to avoid creating these getters and setters and keep the values?

Thanks.


Solution

  • Make sure you DON'T specify Serialization.BEAN, but you also probably don't need analyze either.

    It means it won't try to use getters/setters for serialization (BEAN) but it won't consider its implementation (analyze), I made the assumption that you don't try to parcel managed objects.