5
votes

I've got an application that draws a custom title bar using the following style for the application theme:

<style name="App_Theme" parent="android:Theme">
    <item name="android:windowTitleSize">30dip</item>
    <item name="android:windowTitleBackgroundStyle">@style/App_TitleBackground</item>
</style>

This does not give me the holo theme. So I set the to parent="@android:style/Theme.Holo". This crashes the application with the following error:

E/AndroidRuntime(2048): Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features

Is it disallowed to use custom title bar using:

 requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

Or am I missing something here?

PS:

  • The code works perfectly fine with the parent set to "Android:Theme".
  • I'm using API Level 14
  • 3

    3 Answers

    19
    votes

    Let your activity use a theme with following attribute:

    <item name="android:windowActionBar">false</item>
    
    4
    votes

    mido is correct

    <item name="android:windowActionBar">false</item>
    

    is the solution when using @android:style/Theme.Holo (default for ICS).

    One observation, if you use @android:style/Theme.Holo.NoActionBar change it back to the default @android:style/Theme.Holo.

    0
    votes

    Mostly for the benefit of future visitors, one cannot use Window.FEATURE_CUSTOM_TITLE with Holo themes. Setting android:windowActionBar is not what I wanted, since I wanted a title bar, although a customized one.

    My workaround, was to requestWindowFeature(Window.FEATURE_NO_TITLE) and add another layout that looked like a titlebar in my activity. That way, I get the best of both worlds.