**I am using a dialog** which is show the item of list of string my code is

```
 final CharSequence[] items = {"1", "2", "3"};

            AlertDialog.Builder builder = new AlertDialog.Builder(Activity.this);
            builder.setItems(items, new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int item) {
                    Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
                }

            }).show();

```

now my question is how to implement **onLongClicklistener** method **to delete a selected item** my dialog is looking like shown in image
![**enter image description here**](https://i.stack.imgur.com/Vkob7.png)