Android 4.0和自定义标题栏不工作

Android 4.0和自定义标题栏不工作,android,android-titlebar,Android,Android Titlebar,我有一个android 2.3.3应用程序,我在其中设置了一些自定义标题,如下所示: final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); if ( customTitleSupported ) { getWindow().setFeatureInt(Window.FEATURE_CUSTOM_T

我有一个android 2.3.3应用程序,我在其中设置了一些自定义标题,如下所示:

final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);

if ( customTitleSupported ) 
  {
     getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);
  }

myTitleText = (TextView) findViewById(R.id.myTitle);

if ( myTitleText != null ) 
  {
     myTitleText.setText("MDPI - Main");
  }
MDPIActivity extends Activity implements OnGestureListener, AnimationListener
所有这些行都在onCreate()中写入

在安卓2.3.3中,一切正常。我现在正在尝试为android 4.0制作相同的应用程序,但在设置自定义标题栏时遇到了问题。我发现这个错误:

E/AndroidRuntime(4225): Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
我需要帮助来解决这个错误

我的类的定义如下:

final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);

if ( customTitleSupported ) 
  {
     getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);
  }

myTitleText = (TextView) findViewById(R.id.myTitle);

if ( myTitleText != null ) 
  {
     myTitleText.setText("MDPI - Main");
  }
MDPIActivity extends Activity implements OnGestureListener, AnimationListener

谢谢。

我通过设置另一个主题解决了这个问题,比如这个主题:

android:theme=“@android:style/theme.Black”

在AndroidManiest文件中