title: How to delete item from firebase list adapter and firebase using button
body: <p>I have an activity that reads data from firebase database and displays the data in a firebase list adapter. Each item in the list view has 2 edit text and a button for deleting the item from both the list view and the firebase database. Below is the code for displaying the firebase list adapter</p>
  
  <pre><code>      adapter =new FirebaseListAdapter &lt;TravelDetails&gt;
     ( options){
    protected void populateView(View v, TravelDetails model, int position) {
  Button delete=(Button)v.findViewById(R.id.button_accept);
  final TextView z=(TextView)v.findViewById(R.id.dropoff);
  final TextView text=(TextView)v.findViewById(R.id.txref);
  text.setText(model.getTxt_Ref());
   z.setText(model.getDropoffspot());
   delete.setOnClickListener(new View.OnClickListener() {
       @Override
       public void onClick(View v) {.....
  </code></pre>
  
  <p>The list view works fine. Data is loaded from firebase, but 
  I want to be able to use this button delete to delete items from both the list view and firebase database. I did research and only found ways on item click and not using a button, an example is this <a href="https://stackoverflow.com/questions/48246504/android-studio-remove-items-from-both-listview-and-firebase">Android studio remove items from both listview and firebase</a>  but I don't know how to apply the principle to the button associated with the item from the database . Kindly render assistance</p>
  
  <p>Below is the code of my adapter class
                 public class TravelDetails {</p>
  
  <pre><code>    private String dropoffspot;
      private String txt_Ref;
  
      public TravelDetails(){
  
      }
  
  
      public String getDropoffspot(){
      return dropoffspot;
       }
      public void setDropoffspot(String dropoffspot){
      this.dropoffspot=dropoffspot;
      }
  
      public String getTxt_Ref() {
      return txt_Ref;
      }
  
         public void setTxt_Ref(String txt_Ref) {
         this.txt_Ref = txt_Ref;
       }
  
    } 
  </code></pre>