Difficult question:- Delete list items using onLongPress update adapter
<p>Is there an easy way to delete items in a list using <code>onLongPress</code>. I would like to use <code>OnGestureListener</code> <code>onLongPress</code> to listen for <code>longpress</code> and to delete items in a list and update by adapter accordingly.  The reason is if I use a custom adapter then <code>onlistItemclick</code> and <code>onItemLongClick</code> conflict and longclicking does not trigger anything! </p>

<p>THANK YOU </p>

<p><CODE></p>

<pre>    public void onLongPress(MotionEvent e) {
    // TODO Auto-generated method stub
    Toast.makeText(listmodified.this, "A long click detected", Toast.LENGTH_SHORT).show();
    if (e.getAction()==MotionEvent.ACTION_DOWN) 
    { 

    OnItemLongClickListener itemDelListener = new OnItemLongClickListener(){

            //@Override
            public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View arg1,
                    int position, long arg3) {
                // TODO Auto-generated method stub
                itemSelected=parent.getItemAtPosition(position).toString();

                adapter.remove(itemSelected);
                myList.remove(position);
                adapter.notifyDataSetChanged();
                Toast.makeText(listmodified.this, "IN LONGCLICK", Toast.LENGTH_SHORT).show();
                return false;
            }};


        longClickedItem = -1; 

    } 
</code></pre>
