observeBundleArray

inline fun <T : Any> Activity.observeBundleArray(key: String, crossinline defaultValue: () -> Array<T>? = { null }): Lazy<LiveData<Array<T>>>

Author

skydoves (Jaewoong Eum)

Returns a LiveData which has a references array type of extended data from the Intent. The implementation of the LiveData is a SingleShotLiveData that emits data only a single time to a single observer. We can observe only once using one observer. And the observer will be unregistered from the SingleShotLiveData after observing data at once.

Parameters

key

The name of the desired item.

defaultValue

The value to be returned if no value of the desired type is stored with the given name.

inline fun <T : Any> Fragment.observeBundleArray(key: String, crossinline defaultValue: () -> Array<T>? = { null }): Lazy<LiveData<Array<T>>>

Author

skydoves (Jaewoong Eum)

Returns a LiveData which has a references array type of extended data from the arguments. The implementation of the LiveData is a SingleShotLiveData that emits data only a single time to a single observer. We can observe only once using one observer. And the observer will be unregistered from the SingleShotLiveData after observing data at once.

Parameters

key

The name of the desired item.

defaultValue

The value to be returned if no value of the desired type is stored with the given name.