DEV Community

Discussion on: Implement Dark/Night Mode in an Android app with a ListPreference toggle

Collapse
 
aurumtechie profile image
Neeyat Lotlikar

You will have to also use shared preferences inside your startup/launcher activity to set the dark mode to your desired setting once the activity is created. I have made these changes in the github repo. Take a look. Hope it's helpful.

Collapse
 
fenxe profile image
fenxe

Awesome. One more thing, will the code change if i want to use SwitchPreference?

Thread Thread
 
aurumtechie profile image
Neeyat Lotlikar

Not much really. Even the methods used should remain the same. Switch preference will have to be implemented and that's pretty much it.

Thread Thread
 
fenxe profile image
fenxe

Okay, that really helps.