I can't seems to find out what what is wrong with my codes? i can't pass in non-empty String value into an empty String array?
String[] profiles = wifiPositioningServices.GetAllProfileData();
ArrayList<String[]> macAddresses = new ArrayList<String[]>();
String[] macAddressTemp=null;
//store all profile data into a ArrayList of Profile objects
for(int i=0; i<profiles.length; i++){
String[] result = profiles[i].split(",");
Profile profile = new Profile();
profile.setProfileName(result[0]);
profile.setOwner(result[1]);
profile.setMap(result[2]);
profile.setVisible(result[3]);
boolean visible = Boolean.valueOf(result[3]);
if(visible){
//if visible is true, then add profile name and mac filters into arraylist
profileNames.add(result[0]);
int cnt=0;
for(int j=4; j<result.length; j++){
profile.setMacFiltersList(result[j]);
Log.e("Text:", result[j]);
macAddressTemp[cnt] = result[j];
++cnt;
}
macAddresses.add(macAddressTemp);
}
profileList.add(profile);
}
Java show a nullpointer exception at the line "macAddressTemp[cnt] = result[j];". I am sure that result[j] is not empty cause i was able to print it out via the log msg.