Вопрос

hello i want to change my app theme at runtime, using actionBar compatibility (new api 18) this is my themes:

    <style name="AppThemeDay" parent="@style/Theme.AppCompat.Light">
      <item name="android:actionBarSize">....</item>
    </style>

    <style name="AppThemeNight" parent="@style/Theme.AppCompat">
      <item name="android:actionBarSize">...</item>
    </style>

now i want to change theme into my ActionBarActivity:

if(day){
  setTheme(R.style.AppThemeDay);
} else{
    setTheme(R.style.AppThemeNight);
}

but i have no change.. why?

Это было полезно?

Решение

thank you for your reply! I called setTheme after setContentView(View)..

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top