Restoring dialog created from fragment on rotate
<p>I have a dialog, which is created from a fragment in my application. When I rotate the device, the dialog should reappear in the state it was in before. I have tried setRetainInstance(true) but it doesn't work. </p>

<p>I figured that by saving the dialog's instancestate and adding it into the bundle for onSaveInstanceState() in the fragment, and restoring the instancestate in onActivityCreated() will allow me to restore the dialog. However, I'm getting a null pointer exception when I am trying to restore..</p>

<p>Please help, thanks.</p>
