In order to make a copy of an array that holds a copy of the values instead of by reference I do the following:
int[][][] copy = {{{0}},{{0}},{{0,0}},{{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}},{{0}},{{0,0}}};
System.arraycopy(spelerSpel, 0, copy, 0, spelerSpel.length);
then change a value IN THE COPY:
copy[SPELER_NUMMER][0][0] = baanSpelerNummer;
which results at that moment in the ORIGINAL (spelerSpel) array holding the same changed value, e.g.:
{{{4}},{{0}},{{0,0}},{{0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,0}},{{0}},{{0,0}}};
as the copy. I also tried .clone(), same result. What am I doing wrong?
By the way I target Android API 8, which doe not support Arrays.copyOf().