title: how to implement a long click listener on a listview
body: <p>I want to add <code>OnLongClickListener</code> on my list view. Whenever the user long press the item in list some action should be performed, But my code does not catch this listener. Please let me know where I am going wrong. The similar code works for <code>setOnItemClickListener</code> very well.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
  
              public boolean onItemLongClick(AdapterView&lt;?&gt; arg0, View v,
                      int index, long arg3) {
                  // TODO Auto-generated method stub
                   Log.d("in onLongClick");
                   String str=listView.getItemAtPosition(index).toString();
  
                   Log.d("long click : " +str);
                  return true;
              }
  }); 
  </code></pre>