GameLogic.CROSS不工作 - "类型为id&#34的预期资源;

时间:2016-04-18 06:21:35

标签: android android-studio

我试图从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的预期资源

0 个答案:

没有答案