Try to Use Window.Feature_Custom_Title But Got Exception:You Cannot Combine Custom Titles with Other Title Feature

Try to use Window.FEATURE_CUSTOM_TITLE but got Exception:You cannot combine custom titles with other title feature..

I had the same issue and I fix it deleting

<item name="android:windowNoTitle">true</item>

from my theme.xml

FEATURE_CUSTOM_TITLE / You cannot combine custom title with other title features

I had missed I had a separate styles.xml for never Android phones which used

<style name="AppBaseTheme" parent="android:Theme.Holo.Light">

Replacing that with

<style name="AppBaseTheme" parent="android:Theme.Light">

has made it work

You cannot combine custom title with other title features

I received the same exception.

Here is what I found: In newer versions of Android, the framework will use the Window.FEATURE_ACTION_BAR feature whenever the Holo theme is selected. The framework throws the exception whenever an app calls setFeatureInt(Window.FEATURE_CUSTOM_TITLE) and FEATURE_ACTION_BAR has already been set.

In my case, the styles.xml file in the values-v11 folder was redefining my theme to inherit from android:Theme.Holo. When I attempted to run my app on a Android 3.0 or above - it crashed because Holo uses the ActionBar by default. The fix was simple. Turn the ActionBar off when using Holo. Here is the revised values-v11\styles.xml changes:

<style name="AppBaseTheme" parent="android:Theme.Holo.NoActionBar">
<!-- API 11 theme customizations can go here. -->
</style>

Feature Custom Title: Cannot combine custom titles on API 11 and above

Fixed by my self. I don't know why, but simply adding in manifest file "theme" property for each activity's declaration, all works:

From this:

<activity
android:name=".CheckActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
</activity>

To this:

<activity
android:name=".CheckActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:theme="@android:style/Theme" >
</activity>

You cannot combine custom titles or other title features

I had to move this setContentView to the top, and it worked????????????

@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.fragment_container);
super.onCreate(savedInstanceState);

android.util.AndroidRuntimeException: You cannot combine custom titles with other title features

The theme you are using Theme.AppCompat.Light contains this definition (in its parent):

<item name="android:windowNoTitle">true</item>

So the theme says that it has no title and you are tyring to use a custom title. This is incompatible.

The theme you are using contains an action bar, and the title in the action bar is handled differently. See Styling the Action Bar.


EDIT: Suggestion for light theme without action bar

To get a "light" theme without the action bar (so you can use custom title), this should work:

<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">false</item>
</style>

cannot combine custom titles with other title features and Source code does not match binarycode

So, after trying a lot of things I found...not really a good answer but a workaround for the problem. At least the code is running...

I reset the project to the last running version, using Android Studion v2.1.3 instead of v2.2. The build.gradle looks like this:

    dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.google.code.gson:gson:2.3.1'
}

android {
compileSdkVersion 18
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.sensodrive.vibrotac"
minSdkVersion 10
targetSdkVersion 10
}

and I handled the GATT SDK problem simply using if(Build.VERSION.SDK_INT>18) around everything using GATT.
So if you have a similar problem try if it is possible not to increase the minSDK version in the AndroidManifest.xml but instead just handle the SDK problem at the places where it occurs. May not be the most elegant solution but at least it works...

Oh and another thing:
If you don't have to update to v2.2 don't do it. There is some kind of problem with the line assembleDebug.finalizedBy(copyAPK) in build.gradle and even though there is a workaround for this, I wasn't able to apply it. I guess it is better for your nerves to just stay with the older version until there is an official fix for this problem.

Combine custom title with FEATURE_PROGRESS

As documentation says:

FEATURE_CUSTOM_TITLE

Flag for custom title. You cannot combine this
feature with other title features.

What you can do as you mentioned is to use a custom title bar with a ProgressBar, here is an example how to accomplish that.

In the other hand, why aren't you using Action Bar?.



Related Topics



Leave a reply



Submit