Does anyone know what this error means for Android tabs?

I am trying to try an online tutorial and want to put a tab in the xml layout. I have changes: from Activity to TabActivity. In the xml layout design view, I have the following.

Error during the process after inflation: TabHost requires TabWidget with identifier "android: id / tabs". View found with id 'tabs' is 'com.android.layoutlib.bridge.MockView' Could not find the following classes:

I was looking for a solution, but none of them were fixed, but I found it in another language. I tried using google translator but not very useful.

Someone can get the tab function.

I am using Android 2.2 Api and developing using the Eclipse IDE

+2
source share
5 answers

Known bug http://code.google.com/p/android/issues/detail?id=13092

The user suggested switching the build target to 1.6, and the problem goes away. Obviously a temporary fix.

+3
source

You need a layout like this:

<?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp" /> </LinearLayout> </TabHost> 

See the tab tutorial for more information.

+2
source

Do you have TabWidget with id android: id / tabs, since the error message tells you what you need?

+1
source

I had the same problem. A workaround is described in detail in this link :

Comment 63 by blundell ... @ gmail.com, May 5, 2011

As stated above Quick Fix: just change the API (top left of XML) graphical representation) to 3.0, and you can see it

0
source

Switch to Android 3.0 or 3.1. You can find this dropdown at the top right

0
source

Source: https://habr.com/ru/post/1334572/


All Articles