按钮侦听器中的意外标记

时间:2017-09-26 17:49:00

标签: java android

我为我的应用程序制作了一个按钮监听器,但它说其他是一个意外的令牌,但我不知道为什么。这是我的代码和其他的??????背后是意想不到的令牌,我希望有人可以帮助我:

//Start of Button Listener for Button1
    mButtonChoice1.setOnClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View view) {
            //My logic for Button goes in here

        if (mButtonChoice1.getText() == mAnswerFrankrijk)

            mScoreFrankrijk++;
            updateScore(mScoreFrankrijk);

            //perform check before you update the question
            if (mQuestionNumber == QuestionLibrary.mQuestionsFrankrijk.length) {
                Intent i = new Intent(QuizActivityFrankrijk.this, QuizResultaat.class);
                Bundle bundle = new Bundle();
                bundle.putInt("finalScore", mScoreFrankrijk);
                i.putExtras(bundle);
                QuizActivityFrankrijk.this.finish();
                startActivity(i);
            } else {
                updateQuestion();
            }
        }
        else {
            if (mQuestionNumber == QuestionLibrary.mQuestionsFrankrijk.length) {
                Intent i = new Intent(QuizActivityFrankrijk.this, QuizResultaat.class);
                Bundle bundle = new Bundle();
                bundle.putInt("finalScore", mScoreFrankrijk);
                i.putExtras(bundle);
                QuizActivityFrankrijk.this.finish();
                startActivity(i);
            } else {
                updateQuestion();
            }
        }
    });

 //End of Button Listener for Button1

1 个答案:

答案 0 :(得分:1)

你错过了{在这一行

if (mButtonChoice1.getText() == mAnswerFrankrijk)