title: How to open Menu Context Android with click button in listview adapter?
body: <p>How to open Menu Context Android with click button in listview adapter ?</p>
  
  <p>I tried with my code, but not show the menu context,</p>
  
  <p><strong>code</strong> </p>
  
  <pre><code> public View getView(int position, View convertView, ViewGroup parent) {
        vi=convertView;
      if(convertView==null)
          vi = inflater.inflate(R.layout.tulisan_komentar_list_item,parent, false);
      LinearLayout content_favorite= (LinearLayout)vi.findViewById(R.id.content_favorite);
      final TextView date_komentar = (TextView)vi.findViewById(R.id.date_komentar); // artist name
      final TextView isi_komentar = (TextView)vi.findViewById(R.id.isi_komentar); // duration
      final TextView nama_komentar = (TextView)vi.findViewById(R.id.nama_komentar); // duration
      final TextView id_tulisan_komentar = (TextView)vi.findViewById(R.id.id_tulisan_komentar); // duration
      final ImageButton act_komentar = (ImageButton)vi.findViewById(R.id.act_komentar);
      ImageView thumb_image=(ImageView)vi.findViewById(R.id.avatar_komentar); // thumb image
  
      HashMap&lt;String, String&gt; tulisan = new HashMap&lt;String, String&gt;();
      tulisan = data.get(position);
  
      // Setting all values in listview
      date_komentar.setText(tulisan.get(ContentCommentActivity.TAG_DATE_KOMENTAR));
      isi_komentar.setText(tulisan.get(ContentCommentActivity.TAG_ISI_KOMENTAR));
      nama_komentar.setText(tulisan.get(ContentCommentActivity.TAG_NAMA_KOMENTAR));
      id_tulisan_komentar.setText(tulisan.get(ContentCommentActivity.TAG_ID_TULISAN_KOMENTAR));
      String avatar_komentar = tulisan.get(ContentCommentActivity.TAG_AVATAR_KOMENTAR);
  
      if(hide_gambar.equals("Y")){
          thumb_image.setVisibility(View.GONE);   
      }
  
      else{
          thumb_image.setVisibility(View.GONE);  
           /* thumb_image.setVisibility(View.VISIBLE);   
         if (avatar_komentar.equals("")) {
              thumb_image.setVisibility(View.GONE);
          } else {
              imageLoader.DisplayImage(tulisan.get(ContentCommentActivity.TAG_AVATAR_KOMENTAR), thumb_image);
              thumb_image.setVisibility(View.VISIBLE);   
  
          } */
      }
  
      activity.registerForContextMenu(act_komentar);
  
      act_komentar.setOnClickListener(new android.view.View.OnClickListener() 
      {
  
          public void onClick(View v) 
          {
              activity.openContextMenu(v);
              v.showContextMenu();
  
          }
      });
  
  
      return vi;
  
  }
  
  
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
      menu.setHeaderTitle("My Context Menu");
      menu.add(0, 1, 0, "Add");
      menu.add(0, 2, 0, "Edit");
      menu.add(0, 3, 1, "Delete");
  }
  </code></pre>
  
  <p>can you tell me, how it should work ?</p>