我有一个Activity,用这个XML调用setContentView:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<fragment android:name="org.vt.indiatab.GroupFragment"
android:id="@+id/home_groups"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1" />
<..some other fragments ...>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
GroupFragment扩展了Fragment,一切都很好.但是,我在GroupFragment中显示了一个DialogFragment.这显示正确,但是当屏幕旋转时,我得到一个强制关闭.
从DialogFragment.show(FragmentManager,String)以外的其他片段中显示DialogFragment的正确方法是什么?