title: How to replace Bundle/Argument deprecated get(key) calls in Android
body: <p>I have the following extension functions that allow me to pass bundle data items between my applications activities and fragments.</p>
  <pre><code>inline fun &lt;reified T : Any&gt; Activity.extra(key: String, default: T? = null): Lazy&lt;T?&gt; = lazy {
      val value: Any? = intent?.extras?.get(key)
      if (value is T) value else default
  }
  
  inline fun &lt;reified T : Any&gt; Activity.extraNotNull(key: String, default: T? = null): Lazy&lt;T&gt; = lazy {
      val value: Any? = intent?.extras?.get(key)
      requireNotNull(if (value is T) value else default) { MISSING_MANDATORY_KEY + key }
  }
  
  inline fun &lt;reified T : Any&gt; Fragment.extra(key: String, default: T? = null): Lazy&lt;T?&gt; = lazy {
      val value: Any? = arguments?.get(key)
      if (value is T) value else default
  }
  
  inline fun &lt;reified T : Any&gt; Fragment.extraNotNull(key: String, default: T? = null): Lazy&lt;T&gt; = lazy {
      val value: Any? = arguments?.get(key)
      requireNotNull(if (value is T) value else default) { MISSING_MANDATORY_KEY + key }
  }
  </code></pre>
  <p>the <code>.get(key)</code> methods are all now deprecated and i cannot see how to replace them.</p>
  <p>as it looks as though i will need specific <code>.getXxxx()</code> calls now based on the passed data type.</p>
  <p>what options do i have?</p>
  <p>i like that these extension functions allow me to use one liners such as this:-</p>
  <pre><code>private val bookId by extraNotNull&lt;Long&gt;(EXTRA_KEY_MY_ID)
  
  private val initialItemContentId by extraNotNull&lt;String&gt;(EXTRA_KEY_CONTENT_ID)
  private val initialFilePath by extraNotNull&lt;String&gt;(EXTRA_KEYFILE_PATH)
  private val initialMinPageNumber by extraNotNull&lt;Int&gt;(EXTRA_KEY_MIN_PAGE_NUMBER)
  </code></pre>