title: GridView creating context menu with filter
body: <p>I currently have a grid view with custom array adapter and filter. I am trying to create a context menu based on a long click on a gridview item. However, before adding the filter, I would state which item had been pressed depending on its position, now, when the items are filtered, the positions change so any action taken uses the wrong resource/selects the wrong item. Any idea round this?</p>
  
  <p>Here is my gridview initialization:</p>
  
  <pre><code>final GridView gridview = (GridView) findViewById(R.id.gridview);
      aAdpt = new shareadapter(planetsList, this);
      gridview.setAdapter(aAdpt);
      gridview.setTextFilterEnabled(true);
      this.registerForContextMenu(gridview);
  </code></pre>
  
  <p>Here is my onClickListener (As an example of how I would normally obtain the filtered item to use in an activity/intent:</p>
  
  <pre><code>gridview.setOnItemClickListener(new OnItemClickListener() {
          public void onItemClick(AdapterView&lt;?&gt; parent, View v,
                  int position, long id) {
              Planet link = (Planet) gridview.getItemAtPosition(position);
              Intent i = new Intent(ShareActivity.this,
                      ShareActivitySecond.class);
              i.putExtra("IdImgFull", link.getIdImgFull());
              i.putExtra("IdImgShare", link.getIdImgShare());
              startActivity(i);
              // startSecondActivity(position);
          }
      });
  </code></pre>
  
  <p>And here is my create context menu, as you can see it depends on position and I'm not sure how to add the variable int 
      link.getIdImgShare()</p>
  
  <p>into it.</p>
  
  <pre><code>    @Override
  public void onCreateContextMenu(ContextMenu menu, View v,
          ContextMenuInfo menuInfo) {MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.shareactivity, menu);
  }
  
      @Override
  public boolean onContextItemSelected(MenuItem item) {
      AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
              .getMenuInfo();
      int IndexSelected = info.position;
      switch (item.getItemId()) {
      case R.id.share:
          shareMethod(IndexSelected);
          return true;
      case R.id.save:
          saveMethod(IndexSelected);
          return true;
      default:
          return true;
      }
  }
  </code></pre>