/**
   * Registers the slideup manager, which will listen to and display incoming slideup messages. The
   * current Activity is required in order to properly inflate and display the slideup view.
   *
   * <p>Important note: Every Activity must call registerSlideupManager in the onResume lifecycle
   * method, otherwise slideup messages may be lost!
   *
   * @param activity The current Activity.
   */
  public void registerSlideupManager(Activity activity) {
    // We need the current Activity so that we can inflate or programmatically create the slideup
    // View for each Activity. We cannot share the View because doing so would create a memory leak.
    mActivity = activity;

    // We have a special check to see if the host app switched to a different Activity (or recreated
    // the same Activity during an orientation change) so that we can redisplay the slideup.
    if (mCarryoverSlideup != null) {
      mCarryoverSlideup.setAnimateIn(false);
      displaySlideup(mCarryoverSlideup);
      mCarryoverSlideup = null;
    }

    // Every time the AppboySlideupManager is registered to an Activity, we add a slideup subscriber
    // which listens to new slideups, adds it to the stack, and displays it if it can.
    mSlideupEventSubscriber = createSlideupEventSubscriber();
    Appboy.getInstance(activity).subscribeToNewSlideups(mSlideupEventSubscriber);
  }