java - How to implement Parcelable for an Arraylist of Object which does not implement parcelable? -
i have class in jar file, , not implement parcelable , cannot edit jar file. object response server , need pass next activity using parcelable, class has other class objects. how can achieve ?
here code of class :
//the class arraylist want send activity. //this class inside jar
public class macroconfig implements iconfig, idata { private macroidentifiers identifiers; private arraylist<macrorel> relation; private executionmode executionmode; private arraylist<ruleconfig> ruleconfig; private arraylist<string> instruction; private arraylist<string> _type_id; private string type; @jsonadapter(jsonconverter.class) private arraylist<extension> extension; @jsonadapter(jsonconverter.class) private expansion expand; public macroconfig() { } i tried things mentioned on blogs , other stackoverflow questions didn't find proper solution it.
may u can try alternate way, sender activity:
intent.putextra("myobject",new gson().tojson(listobject)); in oncreate of receiver activity
list<myobject> obj = new gson().fromjson(getintent().getextras().getstring("myobject"), new typetoken<list<myobject>>(){}.gettype());
Comments
Post a Comment