I am having a problem with a Gomoku program I am making (5-in a row on a 10x10 board). I am trying to implement a 10x10 array of buttons from my Game.java to my game.xml. Here is the code I currently have
public class Game extends Activity implements View.OnClickListener{
private boolean p2Turn = false;
private char board[][] = new char[10][10];
Context c;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.game);
Button btn[][] = new Button[10][10];
for(int i = 0; i<10; i++){
for(int j = 0; j<10; j++){
btn [i][j] = new Button(this);
}
}
}
}
However I don't know how to implement the 10x10 button array to my game.xml
Help would be great :D