title: Getting a single item from listfragment using ContextMenu
body: <p>I am trying to get a single item from a listfragment when long pressed is detected using context menu. the thing is the item it gets is the first item in the list and not the one selected, meaning...</p>
  
  <p>if my list looked like this</p>
  
  <p><code>item 5</code>
  <code>item 4</code>
  <code>item 3</code>
  <code>item 2</code>
  <code>item 1</code></p>
  
  <p>and I long press on say <code>item 2</code></p>
  
  <p>it will give me <code>item 5</code></p>
  
  <pre><code>@Override
    public void onCreateContextMenu(ContextMenu menu,View v,ContextMenuInfo menuInfo){
        super.onCreateContextMenu(menu, v, menuInfo);
        menu.add(Menu.NONE,Menu.NONE,Menu.NONE,"Delete");
    }
  
    @Override
    public boolean onContextItemSelected(MenuItem item) {
  
          Vibrator vibrator = (Vibrator)getActivity().getSystemService(Context.VIBRATOR_SERVICE);
          vibrator.vibrate(new long [] {0,20,0,0}, -1);
          TextView tv = (TextView)getActivity().findViewById(R.id.bListTextView);
          name = tv.getText().toString();
          Log.d("List", name);
          Cursor cID = getActivity().getContentResolver().query(BowlersDB.CONTENT_URI,new String[] {BowlersDB.ID,BowlersDB.NAME},BowlersDB.NAME + "=" + name,null,null);
          String nameID = cID.getString(1);
          getActivity().getContentResolver().delete(BowlersDB.CONTENT_URI,"_id" + "=" + nameID,null);
        return super.onContextItemSelected(item);
    }
  </code></pre>
  
  <p>xml</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="match_parent" &gt;
  
  &lt;TextView
      android:id="@+id/bListTextView"
      android:layout_width="wrap_content"
      android:layout_height="60dp"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:text="Large Text"
      android:paddingLeft="10dp"
      android:paddingTop="10dp"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:textSize="30dp" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>in a list view I normally just get the textview by id like this</p>
  
  <pre><code>mContactList = (ListView) findViewById(R.id.contactList);
  mContactList.setOnItemLongClickListener(new OnItemLongClickListener() {
  
          @Override
          public boolean onItemLongClick(AdapterView&lt;?&gt; arg0,View arg1,int arg2,long arg3) {
  
              Vibrator v = (Vibrator)getSystemService(VIBRATOR_SERVICE);
              v.vibrate(new long [] {0,20,0,0}, -1);
              SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(Contacts.this);
              SharedPreferences.Editor edit = pref.edit();
              TextView tv =(TextView)arg1.findViewById(R.id.contactEntryText);
              n = tv.getText().toString();
              edit.putString(SmsPrefs.NAME, n).commit();
              showDialog(1);
              return false;
          }
      });
  </code></pre>
  
  <p>but that method does not seem to work here</p>