Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab Layout tutorial incomplete?

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?

like image 986
Bilthon Avatar asked Feb 23 '10 15:02

Bilthon


2 Answers

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.

like image 60
patridge Avatar answered Oct 15 '22 23:10

patridge


Well thanks for the advice, but I didn't really had to use LogCat. The tutorial is indeed faulty and incomplete, the corrections are very well explained in this related post.

Issues with Android TabHost Example

I'm just amazed by the amount of mistakes in these tutorials, and by the fact that nobody has fixed them yet.

Nelson

like image 45
Bilthon Avatar answered Oct 15 '22 22:10

Bilthon