DialogFragment disappears on rotation despite setRetainInstance(true)
<p>I have a "hello world"-ish sample app that uses the android-support-v4 fragments API.
The activity consists of a button, clicking it will show a DialogFragment.
However, configuration changes like rotation cause the dialog to vanish, even if setRetainInstance(true) is used.</p>

<p>Any idea how to fix this?</p>

<p>RetFragment.java</p>

<pre><code>package me.local.HelloFroyo;

import android.os.Bundle;
import android.support.v4.app.*;
import android.util.Log;
import android.view.*;

public class RetFragment extends DialogFragment {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        return inflater.inflate(R.layout.hello_dialog_fragment, container);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.e("RET", "onDestroy");
    }
}
</code></pre>

<p>MainActivity.java</p>

<pre><code>package me.local.HelloFroyo;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;

public class MainActivity extends FragmentActivity {

    private static final String TAG_DLG = "myFragDlg";

    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.activity_main);
    }

    public void onShowClick(View v) {
        RetFragment ret = new RetFragment();
        ret.show(getSupportFragmentManager(), TAG_DLG);
    }
}
</code></pre>
