Fragment tab host error:Exception raised during rendering: No tab known for tag null
Asked Answered
D

2

6

I have been using the fragment tab host for some time and it was working fine. Suddenly i am getting this layout compilation error.

Exception raised during rendering: No tab known for tag null

activity_tabhost_search.xml:

<android.support.v4.app.FragmentTabHost 
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<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"
        android:layout_weight="0"
        android:orientation="horizontal" />

     <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />
</LinearLayout>

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

Please don't close it as duplicate as I checked all threads but I was not able to solve this.

Dulosis answered 21/1, 2014 at 6:13 Comment(1)
I opened a bug-report, please vote on it: code.google.com/p/android/issues/detail?id=78772Mairamaire
M
0

As I think you have to surround the LinearLayout with TabHost

Maybe also this helps you How do I use tabHost for Android

The Vogella Tab Tutorial as linked in the other topic, works great and I'm using it in my app at the moment.

Morgen answered 21/1, 2014 at 6:40 Comment(1)
Threre is a java code vogella.com/code/ApiDemos/src/com/example/android/apis/app/… but i could not find the layout where I am getting the error.Dulosis
I
0
 <TabWinget android:id="@+id/tabhost"

should be changed to:

 <TabWidget android:id="@android:id/tabhost"
Issiah answered 19/6, 2014 at 11:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.