android - Storing a list of enums in firebase -
i have following code:
public class testclass { public arraylist<objecttypes> list = new arraylist<>(); public testclass(){ list.add(objecttypes.type1); } } public enum objecttypes { type1, type2, type3, type4, } fb.child("test").setvalue(new testclass());
where fb databasereference.
when running code application crashes , following error appears:
com.google.firebase.database.databaseexception: no properties serialize found on class objecttypes
this problem did not appear in old firebase.
the problem solved enumerating enum elements (enumerating enum...)
in above example:
public enum objecttypes { type1(0), type2(1), type3(2), type4(3), }
hopefully easier less boiler plated way added in future?
Comments
Post a Comment