getOrPutExtra

fun <T : Any> Extras.getOrPutExtra(key: Any, block: () -> T): T

Returns the value of the extra with the given key if such an extra exists. Otherwise, returns the result of block and saves it as an extra with the given key.