title: How to pass ArrayList of Objects from one to another activity using Intent in android?
body: <p>I have the following in code in my <code>onClick()</code> method as </p>
  
  <pre><code> List&lt;Question&gt; mQuestionsList = QuestionBank.getQuestions();
  </code></pre>
  
  <p>Now I have the intent after this line, as follows :</p>
  
  <pre><code>  Intent resultIntent = new Intent(this, ResultActivity.class);
    resultIntent.putParcelableArrayListExtra("QuestionsExtra", (ArrayList&lt;? extends Parcelable&gt;) mQuestionsList);
    startActivity(resultIntent);
  </code></pre>
  
  <p>I don't know how to pass this question lists in the intent from one activity to another activity
  My Question class</p>
  
  <pre><code>public class Question {
      private int[] operands;
      private int[] choices;
      private int userAnswerIndex;
  
      public Question(int[] operands, int[] choices) {
          this.operands = operands;
          this.choices = choices;
          this.userAnswerIndex = -1;
      }
  
      public int[] getChoices() {
          return choices;
      }
  
      public void setChoices(int[] choices) {
          this.choices = choices;
      }
  
      public int[] getOperands() {
          return operands;
      }
  
      public void setOperands(int[] operands) {
          this.operands = operands;
      }
  
      public int getUserAnswerIndex() {
          return userAnswerIndex;
      }
  
      public void setUserAnswerIndex(int userAnswerIndex) {
          this.userAnswerIndex = userAnswerIndex;
      }
  
      public int getAnswer() {
          int answer = 0;
          for (int operand : operands) {
              answer += operand;
          }
          return answer;
      }
  
      public boolean isCorrect() {
          return getAnswer() == choices[this.userAnswerIndex];
      }
  
      public boolean hasAnswered() {
          return userAnswerIndex != -1;
      }
  
      @Override
      public String toString() {
          StringBuilder builder = new StringBuilder();
  
          // Question
          builder.append("Question: ");
          for(int operand : operands) {
              builder.append(String.format("%d ", operand));
          }
          builder.append(System.getProperty("line.separator"));
  
          // Choices
          int answer = getAnswer();
          for (int choice : choices) {
              if (choice == answer) {
                  builder.append(String.format("%d (A) ", choice));
              } else {
                  builder.append(String.format("%d ", choice));
              }
          }
          return builder.toString();
         }
  
        }
  </code></pre>