I have the following structure:
I want to delete the record in the database by clicking. How to specify the database number of the record that I want to delete. For example, I tried to delete it, but it did not work either.
Query applesQuery = FirebaseDatabase.getInstance().getReference().child("event").orderByChild("title").equalTo("TITLE"); applesQuery.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot appleSnapshot: dataSnapshot.getChildren()) { appleSnapshot.getRef().removeValue(); } } @Override public void onCancelled(DatabaseError databaseError) { Log.e(TAG, "onCancelled", databaseError.toException()); } }); 