Android Action Bar - With Tabs

23,712

Solution 1

Here is another sample project, covered in one of my books, that demonstrates tabs in the action bar, among other features.

Solution 2

Android has many examples in their APIDemos; ActionBarTabs is one of them.

Solution 3

It's important that you set "Theme.Holo" has your application main theme at the Android Manifest. Any Holo theme will do (Theme.Holo.Light, Theme.Holo.foo.bar)

Your tag has to be something like this

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo" >
Share:
23,712
simplified.
Author by

simplified.

Updated on November 28, 2020

Comments

  • simplified.
    simplified. over 3 years

    I am trying to create a tab action bar on android but I seem to face problems when following tutorials. They usually will have resources which are not shown of which I am also not too sure what are they an causing me not being able to compile the project like in the tutorial. can someone kindly help me out with this. thanks.

  • simplified.
    simplified. almost 13 years
    yeah, i know about that, i tried running it on my tablet but it doesn't seem to work. the thing is that the codes in it have alot of other examples which makes things harder for me to see.
  • Leo Landau
    Leo Landau about 11 years
    For reference, the API Demo for ActionBarTabs, is located at ApiDemos/src/com/example/android/apis/app/ActionBarTabs. I found the FragmentTabs demo also useful – it's in the same folder.