Android的您的内容必须有一个TabHost的id属性是'android.R.id.tabhost“

Android的您的内容必须有一个TabHost的id属性是'android.R.id.tabhost“

问题描述:

您好我创建了一个自定义的标签栏有三个选项卡。我装与谷歌的联系,另一个与小的Hello World应用程序,另一个与之有不同的屏幕分辨率设计的布局一个标签。当我第三个选项卡上挖掘它显示一个错误您的内容必须有一个TabHost的id属性是'android.R.id.tabhost'。但它没有显示出错误,当我装入小应用程序中的第三个选项卡。为什么会发生这样呢?任何一个能帮助我吗?

Hi i created one customised tab bar with three tabs. I loaded one tab with google link, another with the small hello world app and another with the layout which has design for different screen resolutions. When i tap on the third tab it is showing an error "Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'". But it is not showing that error when i load the third tab with small app. Why is it happening like that? Can any one help me?

错误:

12-08 11:50:52.004: ERROR/ACRA(1738): El Gifto fatal error : Unable to start activity ComponentInfo{com.ibkr.elgifto/com.ibkr.elgifto.Ehome}: java.lang.RuntimeException: Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'
12-08 11:50:52.004: ERROR/ACRA(1738): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ibkr.elgifto/com.ibkr.elgifto.Ehome}: java.lang.RuntimeException: Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'
12-08 11:50:52.004: ERROR/ACRA(1738): Caused by: java.lang.RuntimeException: Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'
12-08 11:50:52.004: ERROR/ACRA(1738):     at android.app.TabActivity.onContentChanged(TabActivity.java:105)
12-08 11:50:52.004: ERROR/ACRA(1738):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:210)
12-08 11:50:52.004: ERROR/ACRA(1738):     at android.app.Activity.setContentView(Activity.java:1657)
12-08 11:50:52.004: ERROR/ACRA(1738):     at com.ibkr.elgifto.Ehome.onCreate(Ehome.java:132)

感谢

如果您要使用 TabActivity ,你需要使用 @android :ID / tabhost 的android:你的 TabHost 在XML布局ID 价值文件

If you are going to use TabActivity, you need to use @android:id/tabhost as the android:id value of your TabHost in your xml layout file