How to do the Android tab layout tutorial

When I first tried the Android tab layout tutorial, it didn’t work because the tutorial wasn’t detailed enough.  However, I found the answer to my pr0blems here.

To sum it up, first, you just add the following lines to your AndroidManifest.xml file.

  <activity android:name=".AlbumsActivity"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar">
        </activity>
  <activity android:name=".ArtistsActivity"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar">
        </activity>
          <activity android:name=".SongsActivity"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar">
        </activity>

Then, in addition to the ic_tab_artists.xml file, create both ic_tab_songs.xml and ic_tab_albums.xml. If you don’t have separate images for each tab, just use the same images for each tab (it’s easier that way).

This entry was posted in Android, Programming. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>