我试图从this教程制作tictactoe应用。我在GameActivity.java中的switchTurn中遇到了GameLogic.CROSS的问题:
private void switchTurn(int position) {
if (mTurn == TURN.CIRCLE) {
mBlocks[position].setImageResource(R.drawable.circle);
mBlocks[position].setId(GameLogic.CIRCLE);
mTurn = TURN.CROSS;
mDisplay.setText("CROSS's turn");
} else {
mBlocks[position].setImageResource(R.drawable.cross);
mBlocks[position].setId(GameLogic.CROSS);
mTurn = TURN.CIRCLE;
mDisplay.setText("CIRCLE's turn");
}
mBlocks[position].setEnabled(false);
mStatusCounter++;
if (GameLogic.isCompleted(position + 1, mBlocks)) {
mDisplay.setText(GameLogic.sWinner + " won");
displayStick(GameLogic.sSet);
disableAll();
}else if (mStatusCounter==9){
mDisplay.setText("DRAW. Try again");
}
}
AndroidLogic 2.0在GameLogic.CROSS上显示错误:
类型为id的预期资源