Android 活动主题呈现序列
我想通过java代码改变活动的主题,但它没有像我预期的那样工作。 当我通过Activity.onCreate方法设置自定义主题时,它似乎首先加载mainfest\u Activity\u主题,然后更改为自定义主题 活动:Android 活动主题呈现序列,android,themes,Android,Themes,我想通过java代码改变活动的主题,但它没有像我预期的那样工作。 当我通过Activity.onCreate方法设置自定义主题时,它似乎首先加载mainfest\u Activity\u主题,然后更改为自定义主题 活动: public void onCreate(Bundle savedInstanceState) { // set theme this.setTheme(R.style.custom_theme); super.onCreate(savedInstanceState
public void onCreate(Bundle savedInstanceState) {
// set theme
this.setTheme(R.style.custom_theme);
super.onCreate(savedInstanceState);
// set content view
this.setContentView(..);
//..
}
舱单:
<activity
android:theme="@style/manifest_activity_theme">
<!-- .. -->
</activity>
我希望直接呈现自定义主题,而不是一次加载mainfest\u activity\u主题。如果不希望活动使用清单\u activity\u主题,为什么要使用两个主题?我已尝试在清单中保持应用程序主题和活动\u主题为空,但没有效果。它将首先呈现系统默认主题,然后加载自定义主题。我只想直接加载自定义主题。
manifest_activity_theme -> custom_theme