Q:

How to delete selected item from Firebase database?

I'm beginner in Firebase with android application, I succeed to display a ListView of places, now I want to delete a place  when I click on an item.
This is my attempt:
listPlace.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
    @Override
    public boolean onItemLongClick(AdapterView<?> parent, final View view,final int position, long id) {

     final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(EndroitActivity.this);
        dialogBuilder.setTitle("Delete!");
        dialogBuilder.setPositiveButton("Yes...", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                Place p = list.get(position);
                System.out.println(p.getNomPlace());

                DatabaseReference dR = FirebaseDatabase.getInstance().getReference("place").child(p.getNomPlace());
                dR.removeValue();
            }
        }).setNegativeButton("No", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        Toast.makeText(getApplicationContext(), "Fine, ya coward."
                                , Toast.LENGTH_SHORT).show();
                    }
                });

        dialogBuilder.create().show();

        return true;
    }
});

A:

 DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
Query applesQuery = ref.child("place").orderByChild("nomPlace").equalTo(p.getNomPlace());
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());
}
});

