title: Activity on portrait and DialogFragment on landscape
body: <p>I'm trying to present a DialogFragment on landscape, but my base Activity is locked on portrait (android:screenOrientation="portrait"). I achieved the dialog rotation by doing it during its creation. But, when it is displayed it seems the container is in the old format (the width and height like before rotation) and the rotated dialog doesn't fit inside it. Besides, the container cuts the contents of the dialog.</p>
  
  <pre><code>public class MenuFragment extends DialogFragment {
  
    private final int mOrientation;
  
    public PlantsMenuFragment(int orientation) {
      mOrientation = orientation;
    }
  
  
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
      View mRootView = inflater.inflate(R.layout.fragment_plants_menu,
              container, false);
  
      if (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE == mOrientation) {
          mRootView.setRotation(90);
      }
  
      return mRootView;
    }
  }
  </code></pre>
  
  <p>I've already tried to set it in layout xml, but the result is the same.
  How do I fix it? Or there is a better way to present the dialog in a different orientation of the activity?
  thank you in advance,</p>