Delete listview item in Xamarin [closed]

1

How do I delete an item from my listview? I delete the item, but when I click on the next item the same item that I deleted was selected.

My code:

adapter.Remove("LISTA 1");
adapter.Remove("LISTA 2");
adapter.Remove("LISTA 3");
adapter.Remove("LISTA 4");
    
asked by anonymous 02.05.2017 / 13:35

1 answer

1

Well, I think you can try some of the points I'm going to list below:

  • Verify that your adapter has an overhead to use an ObservableCollection instead of List, since the observablecollection will notify when something changes.

  • You can make the set of your adapter again after removing the item from your list, so it loads a list already without the item that was removed

  • You can check the functioning of the NotifyDataSetChanged of your Adapter, it would be the same operation as the ObservableCollection that I listed first.

02.05.2017 / 15:06