Skip to content Skip to sidebar Skip to footer

Unable To Modify Values In ListView

I'm faced with this problem java.lang.UnsupportedOperationException What I want to do is easy, I'll show you an example. MyList Blue Red Green When I make an OnItemLongClickList

Solution 1:

Look this answer: ArrayAdapter

So basically as in this answer said: "The ArrayAdapter, on being initialized by an array, converts the array into a AbstractList (List) which cannot be modified."

So it easy, create your own ArrayList, in your case of type String, and then assign this to CustomAdapter, then you can just remove items from your ArrayList and notifyDataSetChanged() should works.

Regards


Post a Comment for "Unable To Modify Values In ListView"