想实施"如果" 错误,正确和无法解决的问题的条件,它会在最后显示正确,错误和得分.App运行但没有显示正确的分数。
想要在测验中实施以下格式 -
if(wrong_Click_radioButton) {
wrong++;
nextquestion++;
}
if(correct_Click_radioButton) {
correct++;
nextquestion++;
}
if(not_clicked_any_radioButton) {
nextquestion++;
}
if(last_question_checking) {
score display;
switch to next android activity;
}
想要实施上述概念。
答案 0 :(得分:0)
@Override
public void onClick(View v) {
int id=gr.getCheckedRadioButtonId();
rbtanswer=(RadioButton) findViewById(id);
String answer=rbtanswer.getText().toString();
String check="Google";
if(answer.equals(check)) {
score=score+1;
}
Intent intent=new Intent(Next1Activity.this,Next2Activity.class);
Bundle b=new Bundle();
b.putInt("score",score);
intent.putExtras(b);
startActivity(intent);
Toast.makeText(getApplicationContext(), "Your score is"+score,Toast.LENGTH_SHORT).show();
}
做你喜欢的工作........
答案 1 :(得分:0)