onLifecycleChanged method
生命周期回调监听
Implementation
@override
void onLifecycleChanged(LifecycleOwner owner, LifecycleState state) {
if (state == LifecycleState.onCreate) {
initData();
} else if (state == LifecycleState.onDestroy) {
destroy();
}
}