What is the difference between LiveData and LifecycleObserver

They are really different things which serves two separate roles. In short,

  • LifeCycle addresses the Android lifecycle problems in effective and easy ways. It has two main parts. LifecycleOwner exposes its state changes, and LifecycleObserver listens to these changes to make appropriate steps.
  • LiveData, on the other hand, leverages reactive programming which helps us manipulate data easily. It shares some similarities with Stream in Java 8 and Observer(or Flowable) in RxJava. However, LiveData has an advantage is that it is lifecycle-aware specific for Android. So, it works closely with LifeCycle components.

From a higher abstraction level, I think that:

  • LiveData is a data holder which host some data, with the difference that it's LifeCycle Aware. So it's an observable data holder, not an observer!
  • LifecycleObserver on the other hand is an observer who cares about lifecycles.

I believe that is the main distinction.