I use this code to remove the item in a ListView.

Dim lvi As ListViewItem = DirectCast(ListView1.Items(1), ListViewItem) '/// where (1) is the index of the item
ListView1.Items.Remove(lvi)

But if there's only one item in the listview, I encounter an error.

What code should I write?