I am trying to add the first element of each array in the two-dimensional array folderArray into a one dimensional array called tempArray as can be seen in the code shown below. However I am getting a null pointer exception from the tempArray. How can I fix this?
int listLength = folderArray.length;
String tempArray[] = null;
for(int x = 0; x<listLength;x++){
tempArray[x] = folderArray[x][0];
}