i have a problem with the values of an ArrayList. If I read the values out after I created the ArrayList, it just gifs me the last Value. Array in Listview
I was able to verify, that the problem is in the ArrayList and not somewhere else, but i don't get why.
ArrayList <SubCategory> list = new ArrayList<>();
SubCategory temp = new SubCategory();
temp.setId(SF_DIRECT);
temp.setName(R.string.spell_subcategory_direct);
list.add(temp);
temp.setId(SF_INDIRECT);
temp.setName(R.string.spell_subcategory_indirect);
list.add(temp);
temp.setId(SF_ELEMENTAL);
temp.setName(R.string.spell_subcategory_elemental);
list.add(temp);