how to use OnItemLongClickListener without setOnItemLongClickListener in Android?
<p>I am trying to use OnItemLongClickListener for a listView on Android. This code works fine when added to onCreate method.</p>

<pre><code>mContactList.setOnItemLongClickListener(new OnItemLongClickListener() {
        public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
            Log.e("MyApp", "get onItem Click position= " + position);
            return false;
        }
    });
</code></pre>

<p>However when I try to implement OnItemLongClickListener interface and use this method in the class:</p>

<pre><code>@Override
public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id)   {
    Log.e("MyApp", "get onItem Click position= " + position);
    return false;
}
</code></pre>

<p>nothing happens. What am I missing?</p>
