Setting A Window.feature_custom_title Creates Androidruntimeexception
Solution 1:
This is the kind of error that will drive you to insanity and beyond.
So I happen to be using Theme.Holo
as my parent theme. (The theme that my own theme extends)
The documentation says:
...the action bar is included in all activities that use the Theme.Holo theme (or one of its descendants), which is the default theme when either the targetSdkVersion or minSdkVersion attribute is set to "11" or greater.
http://developer.android.com/guide/topics/ui/actionbar.html#Adding (first paragraph)
Ok, so when I try to go through the process above (my question) I get the error:
You cannot combine custom titles with other title features
Well, that's because, by default action bar is setup already and it won't allow you to use a custom title bar as well.
Documentation reveals that "each activity includes the action bar":
This way, when the application runs on Android 3.0 or greater, the system applies the holographic theme to each activity, and thus, each activity includes the action bar.
So, I will now focus my time on altering the action bar and not the title bar!
Solution 2:
FEATURE_CUSTOM_TITLE
and
<item name="android:windowNoTitle">true</item>
Are mutially exclusive. Remove
<item name="android:windowNoTitle">true</item>
and it will work again.
Solution 3:
As a beginner most of the answers didn't help me for my case. So here is my answer.
Go to res/values folder in your android project and check for strings.xml (this file may vary in your case, something like themes.xml)
Inside the file under resource tag check whether you have style tags. If you don't find it, add the code below as mentioned below as a child to resources tag
something like below
<resources><stylename="SomeNameHere"><itemname="android:windowNoTitle">true</item></style></resources>
if you already have style tag, just add the code below to your style tag
<item name="android:windowNoTitle">true</item>
Post a Comment for "Setting A Window.feature_custom_title Creates Androidruntimeexception"