I have this code that work perfect to delete an item from listview and it disappear. I want to show dialog to ask if the user want to delete an item.
public void ShowdatainlstView() {
    Boodschappenlst.clear();
    final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(
            this,
            android.R.layout.simple_list_item_1,
            Boodschappenlst);
    lstviewProducten.setAdapter(arrayAdapter);
    lstviewProducten.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Boodschappenlst.remove(position);
            arrayAdapter.notifyDataSetChanged();
        }
    });
}
 
    