rook
val myBundleString: String by BundleDelegate.of(MY_BUNDLE_STRING_KEY)
Joel
return extras.get(key)?.let { clazz.cast(it) } ?: throw Exception("Key does not exist in bundle.")
ClassCastException
clazz
Activity
inline fun <reified T> Activity.fromBundle(key: String) = lazy { intent.extras[key] as? T ?: throw Exception("Key does not exist in bundle") }
A modern programming language that makes developers happier.