第二个 Android 11 开发者预览版现已推出,快来测试并分享您的反馈吧

Observer

public interface Observer

androidx.lifecycle.Observer<T>


A simple callback that can receive from LiveData.

Summary

Public methods

abstract void onChanged(T t)

Called when the data is changed.

Public methods

onChanged

public abstract void onChanged (T t)

Called when the data is changed.

Parameters
t T: The new data