我想加载(填充)对当前用户(具有相同的“ Id”)“感兴趣”的所有项目。 查询数据库的问题。找不到匹配项。
mDatabaseReference = FirebaseDatabase.getInstance().getReference().child("App");
FirebaseRecyclerAdapter<My, InterestedEventFragment.InterestedViewHolder> FBRA =
new FirebaseRecyclerAdapter<My, InterestedFragment.InterestedViewHolder>(
My.class,
R.layout.fragment_list_item,
InterestedFragment.InterestedViewHolder.class,
mDatabaseReference.orderByChild("Id")
.equalTo(FirebaseDatabase.getInstance().getReference().child("Users").child(mAuth.getCurrentUser().getUid())
.child("Interested").orderByKey().toString()
)
) { viewHolder.setImage(model.getImage());
viewHolder.setDateTime(model.getDateTime());
viewHolder.setTitle(model.getTitle());
viewHolder.setLocation(model.getLocation());
viewHolder.setUserName(model.getUserName());
viewHolder.setUserImage(model.getUserImage());
}
};
mEventRecyclerView.setAdapter(FBRA);