我正在使用MaterialDrawer 库,在其中我将抽屉设置为折叠项目获取 Firebase 数据库的名称和子项目的名称
但是当我添加一个子项时,它不会出现,直到我再次折叠并展开折叠项。添加数据时如何通知它?
RootRef.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
final int[] t = {0};
Log.i("s =", String.valueOf(dataSnapshot.getKey()));
final ExpandableDrawerItem IntentItemDrawer;
result.addItem(IntentItemDrawer = new ExpandableDrawerItem()
.withName(String.valueOf(dataSnapshot.getKey()))
.withIcon(GoogleMaterial.Icon.gmd_collection_case_play)
.withIdentifier(t[0]++).withSelectable(false)
.withSubItems());
RootRef.child(String.valueOf(dataSnapshot.getKey()))
.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
IntentItemDrawer.withSubItems(new SecondaryDrawerItem()
.withName(String.valueOf(dataSnapshot.getKey()))
.withLevel(2)
.withIcon(GoogleMaterial.Icon.gmd_8tracks)
.withIdentifier(t[