code: private Application.ActivityLifecycleCallbacks createLifecycleCallback() {
  
          return new Application.ActivityLifecycleCallbacks() {
  
              @Override
              public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
              }
  
              @Override
              public void onActivityStarted(Activity activity) {
  
              }
  
              @Override
              public void onActivityResumed(Activity activity) {
                  handleOnResume(activity.getApplicationContext());
              }
  
              @Override
              public void onActivityPaused(Activity activity) {
                  handleOnPause(activity.getApplicationContext());
              }
  
              @Override
              public void onActivityStopped(Activity activity) {
  
              }
  
              @Override
              public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
  
              }
  
              @Override
              public void onActivityDestroyed(Activity activity) {
  
              }
          };
      }
docs: Creates {@link Application.ActivityLifecycleCallbacks} listener that will respond to onResume and onPause of any Activity in the application
  obtaining information if the Application is in the background or foreground.
  
  @return Application lifecycle callbacks to be registered on the system by the SDK.