Android LifecycleRegistry: setCurrentState vs handleLifecycleEevent

May 13, 2019

As per the source code of, they are the same (as both called moveToState).

public void setCurrentState(@NonNull State state) {

NOTE: setCurrentState is more direct, using Lifecycle.State

public void handleLifecycleEvent(@NonNull Lifecycle.Event event) {
    State next = getStateAfter(event);

NOTE: handleLifecycleEvent translate Lifecycle.Event to Lifecycle.State.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.