Click here to Skip to main content
15,890,717 members

Comments by MervinWee (Top 4 by date)

MervinWee 14-Apr-20 6:59am View    
so currently now after making some changes to my MainActivity, i have been able to successfully allow for my switch when flipped to be able to turn on dark mode for my app, however though currently the issue now is that the only switch that is able to do what i have said so far is the switch on my home screen as seen in the image that i have shared above, but what i want is to have the switch in my navigation drawer to be able to be the one to do the change to dark mode. Hence as such could anybody assist me?
MervinWee 13-Apr-20 8:28am View    
hmm, but even after i have removed it the switch it still remains...
MervinWee 13-Apr-20 2:30am View    
yea, and i realised i did not show the error in the layout that i mentioned so here it is.
https://i.stack.imgur.com/DykAO.png

so as such you can see in the image above that i have a switch placed at the top right , but however though i already have a switch in my navigation drawer itself already. hence as such is there any way for which i could remove the switch and ensure that the only switch in existence is the one inside my navigation drawer?
MervinWee 7-Apr-20 2:37am View    
Hi, its this line here:

NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);