title: How to solve Kotlin typecast issue?
body: <p>I want to pass array of custom object through intent.</p>
  
  <pre><code>    val valuesToBeSent =  listOf(
              RSSSource("title", "someurl"),
              RSSSource("title2", "someurl")
      ).toTypedArray()
  
      val i = Intent(this, SecondActivity::class.java)
      i.putExtra("SOURCES", valuesToBeSent)
      startActivity(i)
  
      //ONSECOND ACTIVITY
  
      val rssSources = intent?.extras?.getSerializable("SOURCES") as? Array&lt;RSSSource&gt;
  </code></pre>
  
  <p>I could pass the values like this from one activity to another activity. But it gives following warning in android studio, when I try to typecast value. I converted list into typed array since, list couldn't be pass through intent as extras.</p>
  
  <p><a href="https://i.stack.imgur.com/qCO3F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qCO3F.png" alt="enter image description here"></a></p>
  
  <p>Also, even if I cast it ignoring warning I could access values of the array in second activity in devices supporting SDK > 21 but in devices supporting SDK 19 it crashes the app.</p>
  
  <p>What is the proper way to send the array of custom objects through intent?</p>