I getting this error say
com.google.firebase.database.DatabaseException: Expected a Map while deserializing, but got a class java.util.ArrayList
I try some solution from solution1 solution2 and more, plus some googling for hours but i didn't get any working solution.
so please anyone can help me to understanding this firebase structure database structure image and its solution.
here is my sample code
category object class
public class Category {
private String link;
private String categoryName;
private String activeJob;
private Map<String, JobList> jobList;
....
public Map<String, JobList> getJobList() {
return jobList;
}
public void setJobList(Map<String, JobList> jobList) {
this.jobList = jobList;
}
}
Job list object class
public class JobList {
private String employerName;
private String jobClosingDate;
private String jobCode;
private String jobTitle;
private String jobLink;
private String status;
private String updatedDate;
at MainActivity
public void getJobListFromFirebase() {
ChildEventListener childEventListener = new ChildEventListener() {
@Override
public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
categories = dataSnapshot.getValue(Category.class);
}
@Override
public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
}
.......