类 EaseSingleSourceLiveData<T>

  • 类型参数:
    T - Listening data source type

    public class EaseSingleSourceLiveData<T>
    extends androidx.lifecycle.MutableLiveData<T>
    Use LiveData when setting up and listening to a single data source It is convenient to automatically cancel the monitoring of the previous data source when the data source needs to be switched.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      protected void onActive()  
      protected void onInactive()  
      void setSource​(androidx.lifecycle.LiveData<T> source)
      Set the data source, when there is a data source that has been set, the monitoring of the data source will be canceled
      • 从类继承的方法 androidx.lifecycle.MutableLiveData

        postValue, setValue
      • 从类继承的方法 androidx.lifecycle.LiveData

        getValue, hasActiveObservers, hasObservers, observe, observeForever, removeObserver, removeObservers
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • EaseSingleSourceLiveData

        public EaseSingleSourceLiveData()
    • 方法详细资料

      • setSource

        public void setSource​(androidx.lifecycle.LiveData<T> source)
        Set the data source, when there is a data source that has been set, the monitoring of the data source will be canceled
        参数:
        source -
      • onActive

        protected void onActive()
        覆盖:
        onActive 在类中 androidx.lifecycle.LiveData<T>
      • onInactive

        protected void onInactive()
        覆盖:
        onInactive 在类中 androidx.lifecycle.LiveData<T>