android - Why does DbFlow can not save objects without being assigned to a variable? -


code below works expected

customer x = new customer(); x.name = "yasin"; x.save(); 

but leads app crash

new customer() {   {      name = "yasin";   } }.save(); 

error detail in logcat:

com.raizlabs.android.dbflow.structure.invaliddbconfiguration:  table: com.example.yasin.myapplication.mainactivityfragment$1$1 not registered database. did forget @table annotation? 

why happen? bug dbflow or there don't know java language?

the error getting because in second case extending customer class using anonymous class , dbflow require classes manages annotated, not case anonymous class created. leads error. solution add constructor taking name parameter can like: new customer("the name").save();


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -