LiveData.getValue() returns null with Room

前端 未结 7 893
无人及你
无人及你 2020-12-05 13:16

Java POJO Object

public class Section {

    @ColumnInfo(name=\"section_id\")
    public int mSectionId;

    @ColumnInfo(name=\"section_name\")
    public S         


        
7条回答
  •  生来不讨喜
    2020-12-05 13:59

    For anyone that comes across this. If you are calling LiveData.getValue() and you are consistently getting null. It is possible that you forgot to invoke LiveData.observe(). If you forget to do so getValue() will always return null specially with List<> datatypes.

提交回复
热议问题