jmease
jmease

Reputation: 2535

Cannot Combine Custom Title With Other Title Features

I understand what the error is telling me, but I have no idea what I could be using that it considers title features that I'm trying to combine with Custom Title.

inspection_title.axml

<?xml version="1.0" encoding="utf-8"?>
  <TextView xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/inspectionTitle"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:ellipsize="marquee"
   android:marqueeRepeatLimit="-1"/>

LiftInspection.cs

[Activity(ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait)]
public class LiftInspection : ExpandableListActivity
{       
    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        string callInfo = Intent.GetStringExtra("CallInfo");           

        RequestWindowFeature(WindowFeatures.CustomTitle);
        SetContentView(Resource.Layout.LiftInspection);
        Window.SetFeatureInt(WindowFeatures.CustomTitle, Resource.Layout.inspection_title);

        TextView title = (TextView) FindViewById(Resource.Id.inspectionTitle);
        title.Text = callInfo;
    }

There is no additional title customization in the manifest or anything. What could possibly be combining with the CustomTitle to generate this exception?

Upvotes: 5

Views: 3914

Answers (2)

tartakynov
tartakynov

Reputation: 2858

check in AndroidManifest.xml if your theme's name is "AppTheme", if so try to change it to any other, it's strange but it helped me

Upvotes: 3

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132982

try this way:

final Window window = getWindow();
boolean useTitleFeature = false;
if(window.getContainer() == null) {
    useTitleFeature = window.requestFeature(Window.FEATURE_CUSTOM_TITLE);
}
     SetContentView(Resource.Layout.LiftInspection);
if (useTitleFeature) {
    window.setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.inspection_title);
}

Upvotes: 0

Related Questions