rook
01/15/2021, 4:39 PMrook
01/15/2021, 4:42 PMval myBundleString: String by BundleDelegate.of(MY_BUNDLE_STRING_KEY)Joel
01/15/2021, 10:06 PMreturn extras.get(key)?.let { clazz.cast(it) } ?: throw Exception("Key does not exist in bundle.")ClassCastExceptionclazzrook
01/15/2021, 10:31 PMClassCastExceptionJoel
01/15/2021, 10:32 PMActivityJoel
01/15/2021, 10:33 PMinline fun <reified T> Activity.fromBundle(key: String) = lazy {
    intent.extras[key] as? T ?: throw Exception("Key does not exist in bundle") 
}rook
01/16/2021, 4:38 AM