title: Add a drop down menu for each item of a Custom ListView
body: <p>I have a Custom List view that works perfectly. 
  Now, I  want to have a drop down menu for each item in the list so that when the user taps on any item of the list,the drop down menu shows two options-edit and delete. According to the user's choice the list view item is taken care of.</p>
  
  <p>I want to know the method of adding the drop down menu to each listview item. </p>
  
  <p>xml file for list items-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; 
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent" android:layout_height="120dp"
  android:background="#FFFFFF"&gt;
  &lt;CheckBox
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerVertical="true"
      android:id="@+id/chkitem"
      android:layout_alignParentLeft="true"
     /&gt;
  &lt;TextView android:id="@+id/textTitle"
      android:layout_width="200dp"
      android:layout_height="60dp"
      android:textSize="15dp"
      android:textColor="#000000"
      android:textStyle="bold"
      android:gravity="fill"
      android:layout_toRightOf="@+id/chkitem"
      /&gt;
  &lt;TextView
      android:layout_width="200dp"
      android:layout_height="60dp"
      android:id="@+id/detail"
      android:textSize="15dp"
      android:textStyle="italic"
      android:gravity="fill"
      android:layout_toRightOf="@+id/chkitem"
      android:layout_below="@+id/textTitle"/&gt;
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>adapter class</p>
  
  <pre><code> public class list_addr_adapter extends ArrayAdapter&lt;list_addr&gt; {
  
  Context context;
  int layoutResourceId;
  
  
  
  public list_addr_adapter(Context context, int layoutResourceId,          List&lt;list_addr&gt; items) {
      super(context, layoutResourceId, items);
      this.layoutResourceId = layoutResourceId;
      this.context = context;
      //  this.listener=callback;
  }
  
  /*private view holder class*/
  private class ViewHolder {
  
      TextView txtTitle;
      TextView txtDetail;
  
  }
  ViewHolder holder = null;
  
  public View getView(int position, View convertView, ViewGroup parent) {
      final list_addr lists = getItem(position);
      final int pos=position;
  
  
      LayoutInflater mInflater = (LayoutInflater) context
              .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
      if (convertView == null) {
          convertView = mInflater.inflate(R.layout.items_sav_addr2, null);
          holder = new ViewHolder();
          holder.txtTitle = (TextView) convertView.findViewById(R.id.textTitle);
          holder.txtDetail = (TextView) convertView.findViewById(R.id.detail);
  
          convertView.setTag(holder);
      } else
          holder = (ViewHolder) convertView.getTag();
  
  
  
  
  
  
      holder.txtTitle.setText(lists.getTitle());
      holder.txtDetail.setText(lists.getDetail());
  
      return convertView;
  }
  
    }
  </code></pre>
  
  <p>I want it to be something like this - </p>
  
  <p><a href="https://i.stack.imgur.com/KIgDc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KIgDc.png" alt="enter image description here"></a></p>