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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -