Tab Layout tutorial incomplete?

Bilthon picture Bilthon · Feb 23, 2010 · Viewed 15.2k times · Source

I've been trying to implement the tab UI described in this tutorial: https://developer.android.com/resources/tutorials/views/hello-tabwidget.html

I follow all the steps described in the process but I keep getting a runtime exception which I believe has something to do with the fact that nowhere in the tutorial I added the extra activities (songs, artists and albums) related to the content of each tab into the android manifest file.

Am I correct? is this tutorial (like many others) faulty or incomplete?

Answer

patridge picture patridge · Dec 20, 2010

Since they seem to update these tutorials occasionally, I wouldn't doubt they forgot to mention this part back when this question was asked. They appear to have added a mention to this requirement in the tutorial now (as of 12/20/2010) in step 2:

Duplicate this for each of the three activities, and add the corresponding tags to the Android Manifest file.

Unfortunately, since these are beginner tutorials, they should probably include what the XML tags should look like. Prior to this tutorial, they don't mention how to add activities to the manifest (though you add an activity at the end for hiding the title bar). The markup I used was identical to that on the other question mentioned in the OPs own answer:

<activity android:name=".ArtistsActivity"></activity>
<activity android:name=".AlbumsActivity"></activity>
<activity android:name=".SongsActivity"></activity>

There is a full reference on manifest activities on the Android developer site.