-1

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?

Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148
fabio
  • 271
  • 5
  • 18
  • Did you read setTheme documentation? – Selvin Jul 29 '13 at 15:14
  • 2
    read doc!!!!! *Set the base theme for this context. Note that this should be called before any views are instantiated in the Context (for example **before calling setContentView(View)** or **inflate(int, ViewGroup)**).* – Selvin Jul 30 '13 at 07:55

1 Answers1

0

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

fabio
  • 271
  • 5
  • 18