Skip to content Skip to sidebar Skip to footer

I Cannot Delete Item From Listview

I pass data from a listview to another listview with sharedpreferences. I can write items, I cannot remove an item of them. I dont have error but I have no result. MyActivity final

Solution 1:

Don't create list1, or if you need it for whatever reason, you need to recreate the adapter with it

You should create the first list as this so you can remove from it

list = new ArrayList<>(Arrays.asList(providers)):

Solution 2:

You're never removing the item from the adapter. call remove on the adapter, and update the list in the adapter as well since you maintain a reference to it there.

Post a Comment for "I Cannot Delete Item From Listview"