异常信息如下:
Caused by: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
06-19 14:47:11.777: E/AndroidRuntime(21173): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:310)
06-19 14:47:11.777: E/AndroidRuntime(21173): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3364)
06-19 14:47:11.777: E/AndroidRuntime(21173): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3681)
06-19 14:47:11.777: E/AndroidRuntime(21173): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:368)
06-19 14:47:11.777: E/AndroidRuntime(21173): at android.app.Activity.setContentView(Activity.java:2145)
...
问题原因:
在Activity的onCreate方法中有如下语句:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_offline_map);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.offline_title_bar);
在Manifest文件中,该Activity对应的声明语句中 增加 android:theme属性
<activity android:name="com.example.mdsMap.offline.OfflineActivity"
android:theme="@style/YourTitleBarStyle">
</activity>