Problem running android HelloTabWidget example - NullPointerException on addTab()

后端 未结 12 1180
陌清茗
陌清茗 2021-01-13 17:17

I\'ve tried the Tab Layout example, and I\'ve also fixed the few typos in the example (and added all the activities to the manifest). However, when I run it on the emulator

12条回答
  •  耶瑟儿~
    2021-01-13 17:37

    I too was having trouble with the tab widget tutorial.

    I was onyl able to solve the proble reading this SO post, thansk for the answers guys.

    Going back to the tutorial.... the android dev team could improve their documentation.

    They do infact tell us to add the XML activities to the manifest, they just dont' specify it very well.. here is the quote:

    Notice that this doesn't use a layout file. Just create a TextView, give it some text and set that as the content. Duplicate this for each of the three activities, and add the corresponding tags to the Android Manifest file.

提交回复
热议问题