EmptyEvent

open class EmptyEvent

A data type to be used in Livedata for consumable event like a click. On first call to get method, it will return true. Subsequent calls to get method will return false. When used in live data, observer should handle the event only if get() is true.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun get(): Boolean
get will return the value and consume it.
Link copied to clipboard
open fun peek(): Boolean
use peek to see the value without consuming
Link copied to clipboard
open fun toString(): String