无法解析符号

时间:2016-02-12 08:22:07

标签: android

我创建了一个名为&#34的新课程;问题" (Question.java) 通过在主活动中调用它来创建数组,它就是说无法解析符号。代码如下。 在活动中

private Question [] mQuestionBank = new Question[] {
        new Question (R.string.question_punjab,true),
        new Question (R.string.question_cat, true),
        new Question (R.string.question_wear, false),
        new Question (R.string.question_iPhone, true),
        new Question (R.string.question_shahrukh,false)
};

问题类如下

public class Question {
private int mTextResId;
private boolean mAnswerTrue;

public int getTextResId() {
    return mTextResId;
}

public void setTextResId(int textResId) {
    mTextResId = textResId;
}

public boolean isAnswerTrue() {
    return mAnswerTrue;
}

public void setAnswerTrue(boolean answerTrue) {
    mAnswerTrue = answerTrue;
}

public Question(int textResiD, boolean AnswerTrue) {

    mTextResId = textResId;
    mAnswerTrue = answerTrue;
}
}

1 个答案:

答案 0 :(得分:0)

只需改变你(如评论中所述)

public Question(int textResiD, boolean AnswerTrue) {

    mTextResId = textResId;
    mAnswerTrue = answerTrue;
}

进入

 public Question(int textResId, boolean answerTrue) {

        mTextResId = textResId;
        mAnswerTrue = answerTrue;
    }