onLifecycleChanged method
Implementation
void onLifecycleChanged(LifecycleState lifecycleState) {
switch (lifecycleState) {
case LifecycleState.resumed:
resume(LifecycleState.resumed);
break;
case LifecycleState.paused:
pause(LifecycleState.paused);
break;
case LifecycleState.stopped:
pause(LifecycleState.stopped);
break;
case LifecycleState.destroyed:
cancel(LifecycleState.destroyed);
break;
default:
}
}