Problem running android HelloTabWidget example - NullPointerException on addTab()

后端 未结 12 1087
陌清茗
陌清茗 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:41

    Have you put your activity in the AndroidManifest.xml? You have to tell the application about the activity you want to show, otherwise what you'll got is just an error.

    For example, you can put the following xml code inside the element:

        
            
                
            
        
    

    Hope this will help.

    -Surya Wijaya Madjid

提交回复
热议问题