I have an app which use ListView,I have set onListItemClick event to view details about contact,and I want to implement onLongListItemClick to show a dialog and I don\'t kno
Try like this :
listview.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Toast.makeText(getApplicationContext(), "Long Clicked : ", Toast.LENGTH_LONG).show();
return true;
}
});
You need to add return true;
here otherwise it will transfer control to single click event listener once you release your touch.
Hope it helps you.
Thanks.