How to replace Bundle/Argument deprecated get(key) calls in Android
I have the following extension functions that allow me to pass bundle data items between my applications activities and fragments.
inline fun Activity.extra(key: String, default: T? = null): Lazy = lazy {
val value: Any? = intent?.extras?.get(key)
if (value is T) value else default
}
inline fun Activity.extraNotNull(key: String, default: T? = null): Lazy = lazy {
val value: Any? = intent?.extras?.get(key)
requireNotNull(if (value is T) value else default) {...