title: How do I pass a mutable list to a bundle?
body: <p>I want to add a mutable list to a bundle, but there doesn't seem to be a way to accomplish this.</p>
  
  <pre><code>var bundle = Bundle()
                  bundle.put...????("LIST", fbModel.recipeArray)
  </code></pre>
  
  <p>You can use <code>putString</code> and so on, but there doesn't seem to be a <code>putMutableList</code> as an option. What to do?</p>
  
  <p><strong><em>UPDATE</em></strong>
  Forgot to mention that the <code>mutableList</code> recipeArray is an <code>object</code>. Like this: </p>
  
  <pre><code>var recipeArray: MutableList&lt;RecipeTemplate&gt;
  </code></pre>
  
  <p>...where RecipeTemplate is a class that looks like this:</p>
  
  <pre><code>class RecipeTemplate {
      var recipeHeader: String? = null
      var recipeText: String? = null
      var recipeImage: String? = null
      var recipeKey: String? = null
  }
  </code></pre>
  
  <p><strong><em>UPDATE</em></strong>
  Solved issue according to answer by @EpicPandaForce: </p>
  
  <pre><code>gridView.setOnItemClickListener { parent, view, position, id -&gt;
                  Log.d("TAGA", "CLICKETICLICK " + position)
                  Log.d("TAGA", "CLICKETICLICK " + fbModel.recipeArray[1].recipeHeader) //PASSES
  
                  val intent = Intent(classContext, Recipes::class.java)
  
                  var bundle = Bundle().apply {
                      putParcelableArrayList("LIST", ArrayList&lt;Parcelable&gt;(fbModel.recipeArray))
                      putInt("POSITION", position)
                  }
  
                  intent.putExtra("bundle", bundle)
                  startActivity(intent)
              }
  </code></pre>
  
  <p>But I'm still having problem receiving it in the other activity. Code here from onCreate: </p>
  
  <pre><code>var passedIntent = intent.extras
  var bundle: Bundle = passedIntent.getBundle("bundle")
  var counter: Int = bundle.getInt("POSITION", 0)
  var recipeArray: ArrayList&lt;Parcelable&gt; = bundle.getParcelableArrayList("LIST")
  var recipeList: MutableList&lt;RecipeTemplate&gt; = recipeArray as MutableList&lt;RecipeTemplate&gt;
  
  Log.d("TAGA", "PASSED " + counter) //PASSES
  if(recipeArray != null) {
      Log.d("TAGA", "HERE " + recipeArray[1].recipeHeader.toString()) //Null
      Log.d("TAGA", "HERE " + recipeList[1].recipeHeader.toString()) //Null
      Log.d("TAGA", "HERE " + recipeArray.size) //PASSES
  
  }
  </code></pre>
  
  <p>The <code>counter</code> is passed and the correct number is shown. The <code>recipeArray.size</code> is passed and shows the correct number. However, the other logs <code>recipeArray[1].recipeHeader.toString()</code> and <code>recipeList[1].recipeHeader.toString()</code> are both null even though they contain the correct values before being put in the bundle. Is there something I need to do to... eum... de-parse the list? Or am I missing something?</p>