title: Android DialogFragment disappears after orientation change
body: <p>I have a FragmentActivity support v4 class which implements two side by side (kind of like gmail) fragments and a button which can bring up a DialogFragment. </p>
  
  <p>This all works great unless I have an orientation change. When I have an orientation change the states of the Fragments are not saved.</p>
  
  <p><strong>And the main problem is if I have a the FragmentDialog open, it simply disappears.</strong> </p>
  
  <p>I have set <code>setRetainInstance(true);</code> in all fragments but it did not help.</p>
  
  <p>In my manifest I included <code>android:configChanges="orientation"</code> but is still does not help.</p>
  
  <p>Here are my code samples, thank you for the help.</p>
  
  <pre><code>public class AddMasterDialog extends DialogFragment {
  
      private int mTitle;
      private int mPrompt;
      private OnClickListener onSaveListener;
      private OnClickListener onCancelListener;
  
      public AddMasterDialog newInstance(int title, int prompt) {
          AddMasterDialog simpleDialog = new AddMasterDialog(title, prompt);
          return simpleDialog;
      }
  
      public AddMasterDialog() {
          // Empty constructor required for DialogFragment
      }
      public AddMasterDialog(int title, int prompt) {
          // Empty constructor required for DialogFragment
          mTitle = title;
          mPrompt = prompt;
      }
      public void setSaveButton(OnClickListener save){
          onSaveListener = save;
      }
      public void setCancelButton(OnClickListener cancel){
          onCancelListener = cancel;
      }
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setRetainInstance(true);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
  
          //if(savedInstanceState == null){
              View view = inflater.inflate(R.layout.add_new_simple, container);
              getDialog().setTitle(mTitle);
              ((TextView) view.findViewById(R.id.add_simple_new_value_prompt)).setText(mPrompt);
  
              Button saveButton = (Button) view.findViewById(R.id.add_simple_save_button);
              saveButton.setOnClickListener(onSaveListener);
  
              //Cancel Button
              Button cancelButton = (Button) view.findViewById(R.id.add_simple_cancel_button);
              cancelButton.setOnClickListener(onCancelListener);
              return view;
          //}
      }
  }
  </code></pre>
  
  <p>and in my Main activity:</p>
  
  <pre><code>private void initiateAddMasterPopupWindow() {
          try {
              addMasterDialog = new AddMasterDialog(R.string.add_new_master_dialog_title, R.string.add_master_new_value_prompt);
              addMasterDialog.setSaveButton(saveNewMasterClickListener);
              addMasterDialog.setCancelButton(cancelNewMasterClickListener);
              FragmentManager fm = getSupportFragmentManager();
              addMasterDialog.show(fm, ADD_NEW_MASTER);
  
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  </code></pre>