title: Using list to interact with service android
body: <p>I am making a simple music player, I have made a custom list adapter with 3 textvies and an imagebutton.</p>
  
  <p>I have put an on click listener in button to show dialog box. In dialog box there is an option queue. This option will be used to queue songs in music service. I want to know 
  How can I connect my service with list? 
  If it cannot be connected how can i send the action of this queue button to MainActivity??</p>
  
  <p>Below is my Adapter code</p>
  
  <pre><code>@Override
  public View getView(final int position, View convertView, ViewGroup parent) {
      LayoutInflater inflater = LayoutInflater.from(getContext());
  
      convertView = inflater.inflate(R.layout.songs_list, parent, false);
  
  
      final Song song = getItem(position);
  
      final ImageButton optionsImgBtn = convertView.findViewById(R.id.options_imgbbtn);
      optionsImgBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              PopupMenu optionnMenu = new PopupMenu(getContext(), view);
              optionnMenu.getMenuInflater().inflate(R.menu.list_option, optionnMenu.getMenu());
  
              optionnMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
                  @Override
                  public boolean onMenuItemClick(MenuItem menuItem) {
                      if(menuItem.getItemId()==R.id.vd){
  
  
  
                      }else if(menuItem.getItemId()==R.id.vdi){
  
                      }
                      return true;
                  }
              });
              optionnMenu.show();
          }
      });
  
      TextView txtvDname = convertView.findViewById(R.id.dname_txtv);
      TextView txtvArtist = convertView.findViewById(R.id.artist_txtv);
      TextView txtvDuration = convertView.findViewById(R.id.duration_txtv);
  
  
  
      txtvDname.setText(song.name);
      txtvArtist.setText(song.artist);
      txtvDuration.setText(getFormatedTime(Integer.parseInt(song.duration)));
  
      return  convertView;
  }
  </code></pre>
  
  <p>BTW I am using bound service.</p>
  
  <p><strong>Note : I know how to use onItemLongClickListner but I don't wanna use it I want to use the button I made.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/k05Gp.png" rel="nofollow noreferrer">Button on the right with bars is the button I want to use</a></p>