title: How to pass a list of serializable objects in Jetpack Navigation?
body: <p>I have a class called Post:</p>
  <pre><code>data class Post(
      val id: Long,
      val type: PostType,
      val latitude: Double,
      val longitude: Double,
      val address: String,
  ) : Serializable
  </code></pre>
  <p>I want to pass a list of these objects from one fragment to another using Jetpack Navigation, so I tried to add an argument to my navigation graph like this:</p>
  <pre><code>&lt;fragment
      android:id=&quot;@+id/destination_posts&quot;
      android:name=&quot;com.myapp.android.ui.main.posts.PostsFragment&quot;
      tools:layout=&quot;@layout/fragment_posts&quot;&gt;
      &lt;argument
          android:name=&quot;postsArg&quot;
          app:argType=&quot;com.myapp.android.core.entity.Post[]&quot; /&gt;
  &lt;/fragment&gt;
  </code></pre>
  <p>I tried to do it this way in the first fragment:</p>
  <pre><code>val action = PostsFragmentDirections.actionOpenPostsDetails(posts.toTypedArray())
  navController.navigate(action)
  </code></pre>
  <p>And trying to receive it in the second fragment:</p>
  <pre><code>override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
      super.onViewCreated(view, savedInstanceState)
  
      arguments.let {
          val postsFromArgs = PostsFragmentArgs.fromBundle(it).postsArg
      }
  }
  </code></pre>
  <p>But it throws an exception:</p>
  <pre><code>Type mismatch: inferred type is Array&lt;Post&gt; but Array&lt;(out) Parcelable!&gt;? was expected
  </code></pre>
  <p>I don't understand why it doesn't work, because as I see in documentation this type should be supported(<code>https://developer.android.com/guide/navigation/navigation-pass-data#supported_argument_types</code>)</p>