So I have a custom list view which is populated with Name and phone number. I want to be able to long click on an item in the list view which will then popup a dialog which will allow me to edit the fields or delete the row. How can I do this? Currently I have the code below which just deletes the row if you longClick. I presume I have to create a Dialog class and then call it within the OnLongItemClickLister? I have no idea how to do this however, any help would be great ty.
lvCustomList.setOnItemLongClickListener(new OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
ContactListItems contactListItems = (ContactListItems)arg0.getItemAtPosition(arg2);
String id = contactListItems.getID();
String delQuery = "DELETE FROM PHONE_CONTACTS WHERE id='"+id+"' ";
sqlHandler.executeQuery(delQuery);
showlist();
return false;
}
});