android-您的内容必须有一个 id 属性为“android.R.id.tabhost”的 TabHost;
您好,我创建了一个带有三个选项卡的自定义选项卡栏。我加载了一个带有 google 链接的选项卡,另一个带有小型 hello world 应用程序,另一个带有针对不同屏幕分辨率设计的布局。当我点击第三个选项卡时,它显示错误“您的内容必须具有 id 属性为‘android.R.id.tabhost’的 TabHost”。但当我使用小应用程序加载第三个选项卡时,它没有显示该错误。为什么会出现这样的情况呢?有人可以帮助我吗?
错误:
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)
谢谢
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?
Error:
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)
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您要使用
TabActivity
,则需要使用@android:id/tabhost
作为的
android:id
值xml 布局文件中的 TabHostIf you are going to use
TabActivity
, you need to use@android:id/tabhost
as theandroid:id
value of yourTabHost
in your xml layout file