Firestore Recycler not showing any results on app screen with no errors

后端 未结 2 1961
夕颜
夕颜 2021-01-27 11:40

I want to make a chore app using a firebase that has 2 inputs: Description and class. Whenever I run the app, the screen that shows is blank (except for the header) There is no

相关标签:
2条回答
  • 2021-01-27 11:44

    The problem is that the name of the fields in your Chores class are different than the names that exist in the database. To solve this you should change the property names of chore and time in your model class to description and lenght or you should change the name in the database to match the names in your model class.

    Another workaround might be to use annotations. You can make your fields public and add in front of each fields the following annotations:

    @PropertyName("description")
    public String chore;
    @PropertyName("lenght")
    public String time
    

    So remember, all the fieds names in your models class must match the one that exist in the database.

    0 讨论(0)
  • 2021-01-27 11:56

    Add @Keep to your Chores class to prevent serialization problems:

    import androidx.annotation.Keep;
    
    @Keep
    class Chores {
    .
    .
    }
    
    0 讨论(0)
提交回复
热议问题