Add object to an array object is not work in android

view story

http://stackoverflow.com – I am a new experience of Android. Could anyone help me out with my problem? I want to create a game Tiger fighting with Cow (it is board game). I have a class Piece can be setType as Tiger or Cow and I want to create an array of this class like below. *Note: Piece is extends ImageView Piece[] tigers = new Piece[4]; for (int i=0; i<tigers.length; i++) { tigers[i] = new Piece(context); //want to create an instant of each element tigers[i].setType(R.drawable.tiger); // set type of each element } Piece[] cows = new Piece[12]; for (int i=0; i<tigers.length; i++) { cows[i] = new Cow (HowTos)