因此,我要从Firebase检索数据,如果要满足条件,我想删除一个项目,但不是从数据库recyclerview
中删除该项目
这是我的代码:
for (DataSnapshot roomSnapshot : dataSnapshot.getChildren()) {
minmax.clear();
DataSnapshot priceSnapshot = roomSnapshot.child("promos").child("regular").child(ym).child("price").child(guest);
for (DataSnapshot ds : priceSnapshot.getChildren()) {
minmax.addAll(Collections.singleton(Integer.parseInt("" + ds.getValue())));
minmax.removeAll(Collections.singletonList(0));
if(minmax.isEmpty()){
mAdapter.notifyItemRemoved(holder.getAdapterPosition());
}else{
int min = Collections.min(minmax);
holder.hPrice.setText("Start From " + String.valueOf(min));
}
mAdapter.notifyDataSetChanged();
}
}