Skip to content

Instantly share code, notes, and snippets.

inline fun <reified T> Activity.args(key: String? = null, defaultValue: T? = null): ReadWriteProperty<Activity, T> {
return BundleExtractorDelegate { thisRef, property ->
val bundleKey = key ?: property.name
extractFromBundle(thisRef.intent.extras, bundleKey, defaultValue)
}
}