Android - FragmentTabHost error "No tab known for null tag"

I have the following XML:

<FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/frmTabs" android:layout_below="@+id/ibTop" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:layout_toLeftOf="@+id/vlImagesRight" android:layout_marginRight="10dp" android:layout_marginTop="0dp" android:layout_marginLeft="5dp" android:layout_marginBottom="5dp"> <android.support.v4.app.FragmentTabHost android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/tabHost"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <TabWidget android:id="@+id/tabWidget" android:layout_width="fill_parent" android:layout_alignParentBottom="true" android:layout_height="wrap_content" /> <FrameLayout android:id="@+id/tabContent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/tab_a" android:layout_width="fill_parent" android:layout_height="fill_parent"/> <LinearLayout android:id="@+id/tab_b" android:layout_width="fill_parent" android:layout_height="fill_parent"/> <LinearLayout android:id="@+id/tab_c" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </FrameLayout> </RelativeLayout> </android.support.v4.app.FragmentTabHost> </FrameLayout> 

And my Android studio shows this error:

Rendering exception: no bookmark known for null tag

Comments on the key <android.support.v4.app.FragmentTabHost , and it causes the error to go away.

I can find topics like this one , but I'm curious, after all, after that, it still does not have a simpler solution, like in XML itself.

+7
android xml tabs
source share
1 answer

Change layout to

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="0dip" android:layout_weight="1" /> <android.support.v4.app.FragmentTabHost android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="wrap_content" > <FrameLayout android:id="@android:id/tabcontent" android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="0" /> </android.support.v4.app.FragmentTabHost> </LinearLayout> 
+1
source share

All Articles