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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -