Skip to content Skip to sidebar Skip to footer

I Am Having A Java.lang.unsupportedoperationexception In Android Studio

public boolean onOptionsItemSelected(MenuItem item){ int id = item.getItemId(); switch(id){ case R.id.jaren_3de: updateKlassenList(klassen); break; case R

Solution 1:

I figured it out, thanks to this thread: Why do I get an UnsupportedOperationException when trying to remove an element from a List? I used a LinkedList instead of an ordinary List now, and it works!

Solution 2:

I got to know that I was using this without initialization, so I initialized like this:

//globadl varaible:privateList<ModelClass> ModelDataList;

//code where Used this List.DataList= new LinkedList<>();

This solved my problem.

Post a Comment for "I Am Having A Java.lang.unsupportedoperationexception In Android Studio"