title: Pass Parcelable argument with compose navigation
body: <p>I want to pass a parcelable object (<code>BluetoothDevice</code>) to a composable using compose navigation.</p>
  <p>Passing primitive types is easy:</p>
  <pre class="lang-kotlin prettyprint-override"><code>composable(
    &quot;profile/{userId}&quot;,
    arguments = listOf(navArgument(&quot;userId&quot;) { type = NavType.StringType })
  ) {...}
  </code></pre>
  <pre class="lang-kotlin prettyprint-override"><code>navController.navigate(&quot;profile/user1234&quot;)
  </code></pre>
  <p>But I can't pass a parcelable object in the route unless I can serialize it to a string.</p>
  <pre class="lang-kotlin prettyprint-override"><code>composable(
    &quot;deviceDetails/{device}&quot;,
    arguments = listOf(navArgument(&quot;device&quot;) { type = NavType.ParcelableType(BluetoothDevice::class.java) })
  ) {...}
  </code></pre>
  <pre class="lang-kotlin prettyprint-override"><code>val device: BluetoothDevice = ...
  navController.navigate(&quot;deviceDetails/$device&quot;)
  </code></pre>
  <p>The code above obviously doesn't work because it just implicitly calls <code>toString()</code>.</p>
  <p>Is there a way to either serialize a <code>Parcelable</code> to a <code>String</code> so I can pass it in the route or pass the navigation argument as an object with a function other than <code>navigate(route: String)</code>?</p>