'Delete function is not working in my android project

This is my code for deletion. I have used a button ("deleteProductBtn") to delete products and a method "deleteProduct()". Method is called as follows. But when I run the project delete method is not working. I am using android studio and firebase as my database. Can anybody help me ???

 deleteProductBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            deleteProduct();
        }
    });

}

private void deleteProduct(){
    databaseReference.removeValue();
    Toast.makeText(this, "Product Deleted..", Toast.LENGTH_SHORT).show();
    startActivity(new Intent(EditProductActivity.this,MainActivity.class));

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source