dimanche 30 août 2015

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

Code below works as expected

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

But this leads to an 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 is not
registered with a Database. Did you forget the @Table annotation?

Why does this happen? Is it some bug with DbFlow or there is something I don't know about Java language?

Aucun commentaire:

Enregistrer un commentaire