I need to populate an ExpandableListView
whose data is fetched from Room
database.
There are answers on how to do this with SQLiteDatabase
:
1) Android ExpandableListView and SQLite Database
2) Android ExpandableListView From Database
Is it possible to achieve the same with Room Database?
I have two tables: a) GroupHeader b) GroupContent
@Entity
public class GroupHeader implements Serializable {
@PrimaryKey(autoGenerate = true)
private int groupId;
private String groupName;
private String otherProperty1;
private String otherProperty2;
/* getters and setters */
}
@Entity
public class GroupContent implements Serializable {
@PrimaryKey(autoGenerate = true)
private int contentId;
private int groupId;
private String contentName;
private String otherProperty3;
private String otherProperty4;
/* getters and setters */
}
Any suggestions please?