I can neither get custom title text nor custom title styles working. I must be doing something very wrong, but I can't figure out what (and if the two problems are related)
1) Concerning styles (that seems to be ignored) I have tried this in valyes/styles.xml
<style name="MicWindowTitleBackground">
<item name="android:background">@android:color/black</item>
<item name="android:padding">0px</item>
</style>
<style name="MicWindowTitleTextAppearance">
<item name="android:textSize">20dip</item>
<item name="android:textStyle">bold|italic</item>
</style>
<style name="MicWindowTitle">
<item name="android:textAppearance">@style/MicWindowTitleTextAppearance</item>
</style>
<style name="MicTheme" parent="AppTheme">
<item name="android:windowTitleSize">44dip</item>
<item name="android:windowTitleBackgroundStyle">@style/MicWindowTitleBackground</item>
<item name="android:windowTitleStyle">@style/MicWindowTitle</item>
</style>
And this in AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@drawable/replace__logo__app_android"
android:label="@string/MicAppName"
android:theme="@style/MicTheme"
android:name="com.example.example.MicApp"
>
2) Alternatively, I figured I could use FEATURE_CUSTOM_TITLE which would have the added benefit I could change the title shown in the title bar. However this code errors with error message that I *can not combine FEATURE_CUSTOM_TITLE with other title features* (which I am not to my knowledge...)
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String customTitleStr = getIntent().getExtras().getString("Title");
Boolean customTitleSupported = this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
if ( (customTitleSupported) && (customTitleStr != null) ) {
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.override_titlebar);
final TextView myTitleText = (TextView) findViewById(R.id.myTitleText);
if ( myTitleText != null ) {
myTitleText.setText(customTitleStr);
}
}