Reputation: 258
I'm trying to make a simple list.
I've got this:
String valuesArray[] = {"473", "592", "1774", "341", "355", "473", "950", "500", "44", "946.35", "750", "950"};
List<String> valueList = Arrays.asList(valuesArray);
Whenever I try to add something to the list, it force closes.
valueList.add("Test");
And it really seems to only happen when I try to add to the list. I'm able to get values from the list, just not add to it.
Upvotes: 2
Views: 1108
Reputation: 41858
Another option is to loop through the array and add them in one at a time, then, it won't be a fixed size for the list and you can do all the list operations that you want.
Upvotes: 0