15,890,717 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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);