答案 0 :(得分:0)
在导入时,Parse会将RadioGroup[] radioGroup;
RadioButton[] answer;
RadioButton checkedRadioButton;
radioGroup = new RadioGroup[5];
answer = new RadioButton[4];
int i = 0;
for (Question qn : questions) {
radioGroup[i] = new RadioGroup(this);
int j = 0;
for (Answer an : answers) {
if (qn.getID() == an.getQuestion_id_answer()) {
answer[j] = new RadioButton(this);
radioGroup[i].addView(answer[j]);
answer[j].setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkedRadioButton = ((RadioButton) v);
int CorrectAnswer = Integer.parseInt(checkedRadioButton.getTag().toString());
if (checkedRadioButton.isChecked() & CorrectAnswer == 1) {
Toast.makeText(getApplicationContext(), "Correct answer checked", Toast.LENGTH_SHORT).show();
}
}
});
j++;
}
}
linearLayout.addView(radioGroup[i]);
i++;
}
finishButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkedRadioButton.setTextColor(Color.GREEN);
for (int i = 0; i < radioGroup.length; i++) {
for (int j = 0; j < answer.length; j++) {
radioGroup[i].getChildAt(j).setEnabled(false);
}
}
}
});
网址的唯一ID更改为您的新应用,这就是图片无效的原因。不幸的是,目前无法解决这个问题。
Parse团队正在开发克隆功能,可以将所有记录与文件数据一起移动。这仍在开发中。