Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android.support.v4.app.FragmentTabHost以XML格式呈现_Android_Xml_Fragment Tab Host - Fatal编程技术网

android.support.v4.app.FragmentTabHost以XML格式呈现

android.support.v4.app.FragmentTabHost以XML格式呈现,android,xml,fragment-tab-host,Android,Xml,Fragment Tab Host,我遇到了渲染问题: 呈现期间引发异常:必须调用接受上下文和FragmentManager的setup() 但是如果我从android.support.v4.app.FragmentTabHost改为TabHost,就可以了。我做错了什么?可能重复“是”,但没有答案。很可能是FragmentTabHost中的一个bug。 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:/

我遇到了渲染问题:

呈现期间引发异常:必须调用接受上下文和FragmentManager的setup()


但是如果我从
android.support.v4.app.FragmentTabHost
改为
TabHost
,就可以了。我做错了什么?

可能重复“是”,但没有答案。很可能是
FragmentTabHost
中的一个bug。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.app.FragmentTabHost
        android:id="@android:id/tabhost"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </LinearLayout>

    </android.support.v4.app.FragmentTabHost>

</RelativeLayout>