java.lang.UnsupportedOperationException解决方法

开始的代码:

item.setAnswerpics(Arrays.asList(pointscheckentryList.get(i).getProblems_pics().split(",")))

 

正确的代码:

List<String> picsList = Arrays.asList(pointscheckentryList.get(i).getProblems_pics().split(","));
item.setAnswerpics(new ArrayList(picsList));
-- 多加了一个new ArrayList,这样就可以执行remove操作,否则会报java.lang.UnsupportedOperationException

 

 

 

参考:https://blog.csdn.net/qq_39416311/article/details/83688591

 

posted @ 2022-09-03 13:38  jiduoduo  阅读(93)  评论(0编辑  收藏  举报