how to implement a long click listener on a listview

You have to set setOnItemLongClickListener() in the ListView: lv.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int pos, long id) { // TODO Auto-generated method stub Log.v(“long clicked”,”pos: ” + pos); return true; } }); The XML for each item in the list (should you use a custom XML) must have android:longClickable=”true” as … Read more