removeOnRebindCallback

setLifecycleOwner

void setLifecycleOwner (LifecycleOwner lifecycleOwner)

Sets the LifecycleOwner that should be used for observing changes of
LiveData in this binding. If a LiveData is in one of the binding expressions
and no LifecycleOwner is set, the LiveData will not be observed and updates to it
will not be propagated to the UI.

Parameters

lifecycleOwner

LifecycleOwner: The LifecycleOwner that should be used for observing changes of
LiveData in this binding.

setVariable

Typically, the developer will be able to call the subclass's set method directly. For
example, if there is a variable x in the Binding, a setX method
will be generated. However, there are times when the specific subclass of ViewDataBinding
is unknown, so the generated method cannot be discovered without reflection. The
setVariable call allows the values of variables to be set without reflection.

Parameters

variableId

int: the BR id of the variable to be set. For example, if the variable is
x, then variableId will be BR.x.

value

Object: The new value of the variable to be set.

Returns

boolean

true if the variable is declared or used in the binding or
false otherwise.