I had the same problem and one of the solutions was to use setContentView()
before calling getActionBar()
.
But there was another thing that fixed the problem. I specified theme for the application to be @android:style/Theme.Holo.Light
.
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light" >
...
</application>
I think any theme, which has <item name="android:windowActionBar">true</item>
in it, can be used.