title: OnItemLongClickListener is not working in a custom listview
body: <p>I want context menu to appear after long clicking an item in a custom list view. I am using the <a href="http://actionbarsherlock.com/" rel="nofollow noreferrer">ActionBarSherlock</a>. Trying to debug using Toast notifications I have discovered that Long click event is not fired. How to resolve this issue ?</p>
  
  <pre><code>m_vwJokeLayout=(ListView)findViewById(R.id.jokeListViewGroup);
  m_vwJokeLayout.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
  
              @Override
              public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view,
                      int position, long id) {
                  // TODO Auto-generated method stub
                  if(m_vwActionMode!=null)
                  {
                      Toast.makeText(getApplicationContext(), "Inside On Itemlongclick", Toast.LENGTH_LONG).show();
                      return false;
                  }
                  Toast.makeText(getApplicationContext(), "Inside On Itemlongclick", Toast.LENGTH_LONG).show();
                  m_vwActionMode=getSherlock().startActionMode(m_vwCallback);
                  view.setSelected(true);
                  return true;
              }
  
  
          });
  </code></pre>
  
  <p><strong>The xml code where my <code>ListView</code> is declared is given below:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="fill_parent"&gt;
      &lt;LinearLayout 
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="horizontal"
      &gt;
  
     &lt;Button 
          android:id="@+id/addJokeButton"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/add_joke_button"
          /&gt;
      &lt;EditText 
          android:id="@+id/newJokeEditText"
          android:layout_height="wrap_content"
          android:layout_width="wrap_content"
          android:layout_weight="2"
          android:hint="@string/enter_text_edittext"
          /&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;ListView
          android:id="@+id/jokeListViewGroup"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
  &lt;/ListView&gt;
  
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>The xml code for the <code>View</code> in the custom <code>ListView</code> is given below:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:gravity="center_vertical"
          android:orientation="horizontal"
          android:weightSum="3" &gt;
  
      &lt;LinearLayout
          android:layout_width="200dp"
          android:layout_height="match_parent"
          android:layout_weight="2"
          android:gravity="center_vertical"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:id="@+id/jokeTextView"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginRight="10dp"
              android:ellipsize="middle"
              android:gravity="center"
              android:paddingBottom="10dp"
              android:paddingTop="10dp"
              android:text="Hello,"
              android:textSize="16px"
  
  
               /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_weight="1"
          android:gravity="center_horizontal"
          android:orientation="vertical" &gt;
  
          &lt;RadioGroup
              android:id="@+id/ratingRadioGroup"
              android:layout_width="40dp"
              android:layout_height="60dp"
              android:layout_marginRight="10dp"
              android:gravity="center" 
  
             &gt;
  
              &lt;RadioButton
                  android:id="@+id/likeButton"
                  android:background="@drawable/like"
                  android:button="@null"
                  /&gt;
  
              &lt;RadioButton
                  android:id="@+id/dislikeButton"
                  android:background="@drawable/dislike"
                  android:button="@null"
                  /&gt;
          &lt;/RadioGroup&gt;
  
      &lt;/LinearLayout&gt;
  
     &lt;/LinearLayout&gt; 
  </code></pre>