private void initialiseLifecycleObserver ( Application application ) { LifeCycleController . registerLifeCycleObserver ( application , new LifecycleListener ( ) { @ Override public void onForegrounded ( Context context ) { for ( LifecycleListener listener : lifecycleListeners ) { listener . onForegrounded ( context ) ; } } @ Override public void onBackgrounded ( Context context ) { for ( LifecycleListener listener : lifecycleListeners ) { listener . onBackgrounded ( context ) ; } } } ) ; }
Register for application lifecycle callbacks .