android-您的内容必须有一个 id 属性为“android.R.id.tabhost”的 TabHost;

发布于 2024-12-20 05:36:26 字数 1351 浏览 2 评论 0原文

您好,我创建了一个带有三个选项卡的自定义选项卡栏。我加载了一个带有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱要勇敢去追 2024-12-27 05:36:26

如果您要使用 TabActivity,则需要使用 @android:id/tabhost 作为 android:id 值xml 布局文件中的 TabHost

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文