2011-12-08 52 views
1

嗨,我創建了一個帶有三個選項卡的自定義選項卡欄。我加載了一個帶谷歌鏈接的選項卡,另一個帶有小世界應用程序,另一個帶有針對不同屏幕分辨率設計的佈局。當我點擊第三個標籤時,它顯示一個錯誤「你的內容必須有一個TabHost,它的id屬性是'android.R.id.tabhost'」。但它沒有顯示錯誤,當我加載小應用程序的第三個選項卡。爲什麼會發生這種情況?誰能幫我?android-你的內容必須有一個TabHost的id屬性是'android.R.id.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) 

感謝

回答

4

如果你要使用TabActivity,你需要在你的XML佈局文件使用@android:id/tabhost爲您TabHostandroid:id

相關問題