Class LiveEvent

  • All Implemented Interfaces:

    
    public abstract class LiveEvent<T extends Object>
    extends LiveData<T>
                        

    A lifecycle-aware observable that sends only new updates after subscription.

    This avoids a common problem with events: on configuration change (like rotation) an update can be emitted if the observer is active. This LiveData only calls the observable if there's an explicit call to setValue() or call().

    Note that only one observer is going to be notified of changes.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      LiveEvent()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      • Methods inherited from class androidx.lifecycle.LiveData

        getValue, hasActiveObservers, hasObservers, isInitialized, observe, observeForever, removeObserver, removeObservers
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LiveEvent

        LiveEvent()
    • Method Detail