Fragment tab host error: exception that occurred during rendering: no tab known for null tag

I have been using fragment host for some time and it is working fine. Suddenly, I get this build 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 do not close it as a duplicate, as I checked all the threads, but I could not solve it.

+6
source share
2 answers

I think you should surround the LinearLayout TabHost

Perhaps this will also help you. How to use tabHost for Android

The Vogella Tab tutorial, linked in another topic, works great, and I am using it in my application at the moment.

0
source
  <TabWinget android:id="@+id/tabhost" 

should be changed to:

  <TabWidget android:id="@android:id/tabhost" 
0
source

All Articles