android错误之android.util.AndroidRuntimeException: You cannot combine custom titles with other title

来源:互联网 发布:mysql事务select 编辑:程序博客网 时间:2024/05/17 23:43

报如下错误:android.util.AndroidRuntimeException: You cannot combine custom titles with other title features

这个问题主要是由下面语句造成的。

        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.main);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);

 

原因暂时不是很清楚,在android4.0中会出现,android2.3中没有问题,貌似是title的冲突,解决方法如下:

在你的AndroidManifest.xml中添加相应Active的theme。如添加下面语句可解决:

android:theme="@android:style/Theme.Dialog"

具体的theme选项内容的添加根据你自己的意图选择。

 

 

作者:jason0539

微博:http://weibo.com/2553717707

博客:http://blog.csdn.net/jason0539(转载请说明出处)

 

原创粉丝点击