i get this error, Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.example.cave.Area.setTiles(android.widget.ImageView)' on a null object reference
i tryed to make anything i know...
//this the main
Area[] area = new Area[9];
ImageView[] tiles = new ImageView[9];
for(int i=1; i<=9; i++)
{
area[i].setTiles(tiles[i]);
}
//this is the second class
public class Area {
ImageView tiles ;
public ImageView getTiles() {
return tiles;
}
public void setTiles(ImageView tiles) {
this.tiles = tiles;
}
//
i want to create tiles, 9 x 9, this is for area 1, than i want another area,
area 2, area 3 ... area 9... i want to create imageview array to call it in a
class of areas array...
//