I have a object that contains another object and I'd like to send to from one fragment to another, using parcelable, like:
Fragment fragment = new Fragment();
Bundle bundle = new Bundle();
bundle.putParcelable(mykey, Parcels.wrap(MySubObj));
fragment.setArguments(bundle);
The structure of the MyObj's POJO:
class MyObj {
String value;
MySubObj value2;
//geters & seters
@Parcel
class MySubObj {
String name;
int age;
ActivityDomain acdomani;
//geters & seters
@Parcel
public class ActivityDomain {
String name;
String field;
int countEmpl;
//geters & seters
}
}
}
So at Parcels.wrap(MySubObj)
I am getting this error:
org.parceler.ParcelerRuntimeException: Unable to find generated Parcelable class for com.mypakage.MyObj$MySubObj , verify that your class is configured properly and that the Parcelable class com.mypakage.MyObj$MySubObj$$Parcelable is generated by Parceler.
I am missing something?