Issue with displaying TabHost Layout in new Intent

后端 未结 9 2121
悲哀的现实
悲哀的现实 2021-01-20 21:05

I am having an issue with using TabHost in a new Intent of type TabActivity which I hope you can point me in the right direction. Funnily it works fine when I try to view it

9条回答
  •  粉色の甜心
    2021-01-20 21:29

    I have previously constructed tabhosts with an id of android:id="@+id/tabhost". Does this work for you?

    You could also consider constructing your tab view programmatically:

        TabHost t = getTabHost();
        TabSpec tab = t.newTabSpec(label)
                       .setIndicator(label, icon)
                       .setContent(intent);
        t.addTab(tab);
    

提交回复
热议问题