Reputation: 35
I would like to do a small upgrade of my application and I would like the theme to change to dark mode after pressing SwitchPreference. I need a detailed guide or someone to explain to me exactly how to do it. If I am just learning to do something in SettingsFragment but it does not come easily to me, please help. If you do not understand the question, please write in the comments, I will try to explain everything so that the help is the best
Upvotes: 1
Views: 419
Reputation: 124
I don't think this is the easiest way but you can give it a shot. What you will do is to save a shared preference I will call it theme. And set it to light or dark based on user preference. Then in homepage on create method call the shared preference and set your app theme based on what your user have set already.
I don't know if you get the idea but this is best I can explain..
Upvotes: 0