title: One Activity does not send Intent to another Activity
body: <p>I got a problem: the first activity (below) doesn't send intent to second activity. </p>
  
  <p>Here is MainActivity.java</p>
  
  <pre><code>package com.example.quizjavatest;
  
  
  import android.os.Bundle;
  import android.app.Activity;
  import java.util.List;
  import android.content.Intent;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ImageView;
  import android.widget.RadioButton;
  import android.widget.RadioGroup;
  import android.widget.TextView;
  
  public class MainActivity extends Activity  {
  
      List&lt;Question&gt; quesList;
      int score=0;
      int qid=0;
      ImageView quizimg; 
      Question currentQ;
      TextView txtQuestion;
      RadioButton rda, rdb, rdc;
      Button butNext;
  
  @Override
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
              DbHelper db=new DbHelper(this);
              quesList=db.getAllQuestions();
              currentQ=quesList.get(qid);
  
              txtQuestion=(TextView)findViewById(R.id.textView1); //question
              rda=(RadioButton)findViewById(R.id.radio0); //option A
              rdb=(RadioButton)findViewById(R.id.radio1); //option B
              rdc=(RadioButton)findViewById(R.id.radio2); //option C
              quizimg=(ImageView) findViewById(R.id.ImgQuiz); //img quiz
              butNext=(Button)findViewById(R.id.button1); //button next
              setQuestionView();
  
  
              butNext.setOnClickListener(new View.OnClickListener() {     
                  @Override
                  public void onClick(View v) {
                      RadioGroup grp=(RadioGroup)findViewById(R.id.radioGroup1);
                      RadioButton answer=(RadioButton)findViewById(grp.getCheckedRadioButtonId());
                      Log.d("yourans", currentQ.getANSWER()+" "+answer.getText());
                      if(currentQ.getANSWER().equals(answer.getText()))
                      {
                          score++;
                          Log.d("score", "Your score"+score);
                      }
                      if(qid&lt;5){                  
                          currentQ=quesList.get(qid);
                          setQuestionView();
                      }else{
                          Intent intent = new Intent(getApplicationContext(), ResultActivity.class);
                          Bundle b = new Bundle();
                          b.putInt("score", score); //Your score
                          intent.putExtras(b); //Put your score to your next Intent
                          startActivity(intent);
                          finish();
                      }
                  }
              });
  }
  
          private void setQuestionView()
          {
  
              txtQuestion.setText(currentQ.getQUESTION());
              rda.setText(currentQ.getOPTA());
              rdb.setText(currentQ.getOPTB());
              rdc.setText(currentQ.getOPTC());
              quizimg.setImageBitmap(currentQ.getBitmap());
              qid++;
          }
  }
  </code></pre>
  
  <p>ResultActivity.java</p>
  
  <pre><code>package com.example.quizjavatest;
  
  import android.os.Bundle;
  import android.app.Activity;
  
  import android.widget.RatingBar;
  import android.widget.TextView;
  
  public class ResultActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.act_results);
  
  
          RatingBar bar=(RatingBar)findViewById(R.id.ratingBar1); 
          bar.setNumStars(5);
          bar.setStepSize(0.5f);
          //get text view
          TextView t=(TextView)findViewById(R.id.textResult);
          //get score
          Bundle b = getIntent().getExtras();
          int score= b.getInt("score");
          //display score
          bar.setRating(score);
          switch (score)
          {
          case 1:
          case 2: t.setText("Oopsie! Better Luck Next Time!");
          break;
          case 3:
          case 4:t.setText("Hmmmm.. Someone's been reading a lot of trivia");
          break;
          case 5:t.setText("Who are you? A trivia wizard???");
          break;
          }
      }
  }
  </code></pre>