0

I have my dark and light styles setup.

I want the user to be able to change from light/dark theme in my settings activity.

I have the dialog that pops up and lets choose light or dark.

I have read that this cannot be done dynamically and that fine. I dont mind the app restarting for changes to apply.

I have seen other apps like falcon pro that allow this. i have it setup just like that. in falcon pro it asks if you want to restart app now or later.

BigDX
  • 3,519
  • 5
  • 38
  • 52

1 Answers1

0

Activity has a setTheme method. You have to call it at any activity, or better create a BaseActivity which does that and inherited any of your Activities by that BaseActivity

Switching application-wide theme programmatically?

Community
  • 1
  • 1
fish
  • 828
  • 1
  • 6
  • 14
  • so my main activity starts then the user can click settings to go to my settings activity. That is where they can change the light/dark theme. i read this from the link you provided `To set the theme dynamically at runtime, call setTheme() in your activity's onCreate() method, before calling setContentView(). To change the theme, you simply need to restart your activity.` but how am i supposed to implement that to the main activity? – BigDX Mar 22 '13 at 23:32