Delete item from listview when the item is clicked
<p>I currently have this code to display chosen items in a listview:</p>

<pre><code>public class DisplayOrder extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_display_order);
    bar();

    Button btn = (Button) findViewById(R.id.btnHome);
    btn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent myIntent = new Intent(DisplayOrder.this, Options.class);
            startActivity(myIntent);

        }
    });
}

private void bar() {


    ListView lv = (ListView) findViewById(R.id.listViewDisplay);

    List&lt;String&gt; itemsOrdered = new ArrayList&lt;String&gt;();


    for (Map.Entry&lt;Item, Integer&gt; entry : Datastore.currentTable.getOrder().getItems().entrySet()) {
        itemsOrdered.add((entry.getKey().name) + " x " + String.valueOf(entry.getValue()) + " £" + (entry.getKey().price * entry.getValue()));
    }


    // This is the array adapter, it takes the context of the activity as a
    // first parameter, the type of list view as a second parameter and your
    // array as a third parameter.
    ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;String&gt;(getBaseContext(), R.layout.activity_display_order, R.id.textView8, itemsOrdered);

    lv.setAdapter(arrayAdapter);
}
}
</code></pre>

<p>What i want to do is, when I click one of the items, for it to be deleted but Im not sure how to do that. Any guidance would be much appreciated.</p>