I have this code in my populateViewHolder :
public void populateViewHolder(final CampaignHolder viewHolder, final Campaign campaign, final int position) { String k = getRef(position).getKey(); ref.child(k).child("users").addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if (!dataSnapshot.hasChild(getUid())) {
I want to delete the item if !dataSnapshot.hasChild(getUid()) is true , otherwise just keep filling the ViewHolder as usual. Please note: I do not want the item to be deleted from the database , I want it to disappear from the FirebaseRecyclerAdapter . What method is available for this?
Edit: I ALWAYS searched for a solution to this problem since it was not fixed . My decision is HIGHLY discouraged and very bad practice, and I changed my mind to use it myself.
android firebase firebase-database firebaseui
Ab_
source share