code: public MenuItemTransition setInvalidateOptionOnStopTransition(@NonNull Activity activity, boolean invalidate) {
          this.mActivityRef = new WeakReference<>(activity);
          this.mInvalidateOptionOnStopTransition = invalidate;
          return self();
      }
docs: Sets whether or not to call {@link Activity#invalidateOptionsMenu()} after a transition stops.
  
  @param activity   Activity that should have its {@link Activity#invalidateOptionsMenu()} method
  called, or null if invalidate parameter is false.
  @param invalidate
  @return