code: @UiThread
      public void postWhenResumed(Runnable action) {
          if (!mStateSaved) {
              if (mHandler == null) {
                  mHandler = new Handler();
              }
              mHandler.post(action);
          } else {
              if (mPosts == null) {
                  mPosts = new ArrayDeque<>();
              }
              mPosts.offer(action);
          }
      }
docs: If {@link #onSaveInstanceState(Bundle) onSaveInstanceState} hasn't been called yet, post the
  action now. Otherwise save the action and run it when the Activity resumes.