Issue with setting Dark theme programatically
See original GitHub issueHi @zawadz88,
I am trying to set dark theme programatically using below API in Java:
MaterialPopupMenuBuilder popupMenuBuilder = new MaterialPopupMenuBuilder(); popupMenuBuilder.setStyle(R.style.Widget_MPM_Menu_Dark);
It is working as expected for text color but not for background color:

I am not sure if I am missing something, can you please guide on how to set the Dark theme programatically.
Thanks Pranav
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to enable night mode programmatically? - Stack Overflow
enable dark theme: AppCompatDelegate. · forcefully disable dark theme: AppCompatDelegate. · set app theme based on mobile settings of dark mode, i.e. if...
Read more >Moving to the Dark Side: Dark Theme Recap - ProAndroidDev
Check whether Dark Theme is applied programmatically Sometimes you might want to customize your UI based on a theme at runtime. You can...
Read more >Dark theme - Android Developers
There are three ways to enable Dark theme in Android 10 (API level 29) and higher: Use the system setting (Settings -> Display...
Read more >Change theme programmatically in WinUI 3 preview ... - GitHub
I'm trying to change the theme of the app programmatically App.Current.RequestedTheme = themes.SelectedIndex == 0 ? ApplicationTheme.Dark ...
Read more >Setting up Dark Theme for Your App - Wajahat Karim
To manage this, Android provides you a way to separate resources for light and dark themes. Normally, you put all your colors in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @prscX, This should be fixed in the newly released 1.4.0.
Thanks for reporting this!
Many Thanks @zawadz88 for release. I have tested and is working as expected.
Thanks Pranav