title: savedInstanceState when restoring fragment from back stack
body: <p>Can I use <code>savedInstanceState()</code> to save the state when removing a fragment, then restore the state when I pop the fragment off the back stack?  When I restore the fragment from the back stack, savedInstanceState bundle is always null.</p>
  
  <p>Right now, the app flow is: fragment created -> fragment removed (added to back stack) -> fragment restored from back stack (savedInstanceState bundle is null).</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>public void onActivityCreated(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Bundle bundle = getArguments();
      Long playlistId = bundle.getLong(Constants.PLAYLIST_ID);
      int playlistItemId = bundle.getInt(Constants.PLAYLISTITEM_ID);
  
      if (savedInstanceState == null) {
         selectedVideoNumber = playlistItemId;
      } else {
         selectedVideoNumber = savedInstanceState.getInt("SELECTED_VIDEO");
      }
  }
  
  public void onSaveInstanceState(Bundle outState) {
          super.onSaveInstanceState(outState);
          outState.putInt(Constants.SELECTED_VIDEO, selectedVideoNumber);
      }
  </code></pre>
  
  <p>I think the problem is that <code>onSavedInstanceState()</code> is never called when being removed and being added to back stack.  If I cant use onsavedInstanceState(), is there another way to fix this?</p>