I have some problem about reading value in Firebase Database, This is structure of Realtime Database, sorry I wasn't allowed to embedded picture:
- LampController
- Schedule
- TimeEnd: "5:30"
- TimeStart: "21:15"
- isActive: true
- Schedule
This is my Object class, also contains Constructor, Getter and Setter:
public class ScheduleObject {
private String TimeEnd;
private String TimeStart;
private Boolean isActive;
...
}
When I use dataSnapshot.getValue(ScheduleObject.class), I will get values from TimeEnd and TimeStart but isActive is always return null. Seem like it didn't get the value on Firebase but I don't know why?
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()) {
scheduleObject = new ScheduleObject();
scheduleObject = dataSnapshot.getValue(ScheduleObject.class);
}
}
Only when I use dataSnapshot.child("isActive").getValue(Boolean.class) its will return value from Firebase. Thanks for any help!