I am creating a quiz app. the code pasted down is the second activity of the app. But it stated the int point = 0, and the finalpoints is not stated because it depends on the answers in the quiz. However do i pass whatever answer in this activity is passed to the next one and the next.
here is the code for the activity2:
 package com.example.android.questionme;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.RadioButton;
import android.widget.Toast;
public class Main2Activity extends AppCompatActivity {
    Intent intent = getIntent();
    int point = 0;
    int finalpoints;
    RadioButton option1forQ1;
    RadioButton option2forQ1;
    RadioButton option1forQ2;
    RadioButton option2forQ2;
    RadioButton option3forQ2;
    RadioButton option4forQ2;
    RadioButton option1forQ3;
    RadioButton option2forQ3;
    RadioButton option3forQ3;
    RadioButton option1forQ4;
    RadioButton option2forQ4;
    RadioButton option3forQ4;
    RadioButton option4forQ4;
    RadioButton option1forQ5;
    RadioButton option2forQ5;
    RadioButton option3forQ5;
    RadioButton option4forQ5;
    CheckBox option1forQ6;
    CheckBox option2forQ6;
    CheckBox option3forQ6;
    CheckBox option4forQ6;
    RadioButton option1forQ7;
    RadioButton option2forQ7;
    RadioButton option3forQ7;
    RadioButton option4forQ7;
    RadioButton option1forQ8;
    RadioButton option2forQ8;
    RadioButton option3forQ8;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        option1forQ1 = (RadioButton) findViewById(R.id.right_answer_for_Q1);
        option2forQ1 = (RadioButton) findViewById(R.id.wrong_answer_for_Q1);
        option1forQ2 = (RadioButton) findViewById(R.id.question_two_right_answer);
        option2forQ2 = (RadioButton) findViewById(R.id.question_two_wrong_answer0);
        option3forQ2 = (RadioButton) findViewById(R.id.question_two_wrong_answer1);
        option4forQ2 = (RadioButton) findViewById(R.id.question_two_wrong_answer2);
        option1forQ3 = (RadioButton) findViewById(R.id.question_three_right_answer);
        option2forQ3 = (RadioButton) findViewById(R.id.question_three_wrong_answer0);
        option3forQ3 = (RadioButton) findViewById(R.id.question_three_wrong_answer1);
        option1forQ4 = (RadioButton) findViewById(R.id.question_four_wrong_answer0);
        option2forQ4 = (RadioButton) findViewById(R.id.question_four_right_answer);
        option3forQ4 = (RadioButton) findViewById(R.id.question_four_wrong_answer1);
        option4forQ4 = (RadioButton) findViewById(R.id.question_four_wrong_answer2);
        option1forQ5 = (RadioButton) findViewById(R.id.question_five_wrong_answer0);
        option2forQ5 = (RadioButton) findViewById(R.id.question_five_wrong_answer1);
        option3forQ5 = (RadioButton) findViewById(R.id.question_five_wrong_answer2);
        option4forQ5 = (RadioButton) findViewById(R.id.question_five_right_answer);
        option1forQ6 = (CheckBox) findViewById(R.id.question_six_right_answer);
        option2forQ6 = (CheckBox) findViewById(R.id.question_six_wrong_answer);
        option3forQ6 = (CheckBox) findViewById(R.id.question_six_wrong_answer1);
        option4forQ6 = (CheckBox) findViewById(R.id.question_six_right_answer1);
        option1forQ7 = (RadioButton) findViewById(R.id.question_seven_wrong_answer);
        option2forQ7 = (RadioButton) findViewById(R.id.question_seven_wrong_answer1);
        option3forQ7 = (RadioButton) findViewById(R.id.question_seven_right_answer);
        option4forQ7 = (RadioButton) findViewById(R.id.question_seven_wrong_answer2);
        option1forQ8 = (RadioButton) findViewById(R.id.question_eight_wrong_answer);
        option2forQ8 = (RadioButton) findViewById(R.id.question_eight_right_answer);
        option3forQ8 = (RadioButton) findViewById(R.id.question_eight_wrong_answer2);
    }
    public void onYesRadioButtonClicked (View view){
        Intent intent = new Intent(this, Main3Activity.class);
        boolean option1forQ1IsChecked = option1forQ1.isChecked();
        boolean option2forQ1IsChecked = option2forQ1.isChecked();
        if (option1forQ1IsChecked) {
            point *= 2;
            startActivity(intent);
            Toast.makeText(this, "Good Start"+ "2 Points", Toast.LENGTH_SHORT).show();
        }
        else
        if (option2forQ1IsChecked) {
            point -= 1;
        }
    }
    public void onNoRadioButtonClicked (View view){
        boolean option2forQ1IsChecked = option2forQ1.isChecked();
        if (option2forQ1IsChecked){
        Toast.makeText(this, "Wrong Answer, You can Google about Google on Google"
                , Toast.LENGTH_SHORT).show();
        }
}
}
 
     
     
    