question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem when trying to disable dark mode on Android.

See original GitHub issue

Hello people, I’m learning react / react native and along, making an app to practice. What is happening is that when the device’s darkmode is active it implies the colors chosen in the application (an example below). I do not intend to invest time in and do darkmode now, I would like to learn more about React, make the whole app, and then go to the more “superficial” parts and make darkmode within the config of the app itself.

Would it be possible to inhibit / prevent the device’s Dark Mode from interfering with the colors of the app?

It’s done with my app design 😥

I’m testing the app on a Xiaomi Mi 9T Pro, I also tested it on the S10 + and it didn’t happen, it seems that MiUI forces DarkMode … Thank you.

React Native version:

“react”: “16.11.0”, “react-native”: “0.62.2”,

Possible solutions that I was unable to make work.

I found the following code below talking to put in the onCreate method of MainActivity.java, however it does not have this method there. I don’t know where and how I can do it. AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)

107943046_3977108782364325_148255309064123217_n

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:15
  • Comments:22 (1 by maintainers)

github_iconTop GitHub Comments

58reactions
amerllicacommented, Oct 13, 2020

Dear @RBalconi, the exact solution to turn off the force dark mode on Android is this Stack Overflow post.

@RigottiG @joan2404 @ff-joaquin-rojas @eliasjnior @inferusvv

17reactions
ff-joaquin-rojascommented, Oct 13, 2020

Dear @RBalconi, the exact solution to turn off the force dark mode on Android is this Stack Overflow post.

@RigottiG @joan2404 @ff-joaquin-rojas @eliasjnior @inferusvv

I don’t know who you are or where you came from, but thank you, it works like a charm! You deserve all the best!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable dark mode in play store. I don't like it. Please ...
[3] If you've waited a few minutes and the issue persists, please check Settings -> Developer > Dark theme and ensure this is...
Read more >
How to disable dark theme in Android Pie?(Pre Android 10)
I know adding background to XML dosen't seems solution but in some case/some device it will show dark theme. Delete night theme XML...
Read more >
How to Fix Dark Mode Isn't Turning off in Android - YouTube
How to Fix Dark Mode Isn't Turning off in Android Hindi-UrduIn Android How to Fix Dark Mode Isn't Turning off Dark Mode Is...
Read more >
How to Disable Dark Mode in Google Apps - Guiding Tech
Disable Dark Mode on Google Calendar ... Here are the steps: Step 1: Open the Google Calendar app on your phone. Step 2:...
Read more >
[SOLVED] Dark mode, cannot choose individual app to apply ...
Had the same problem, the hint about disabling Wi-Fi got me to the root of the problem: I'm using Blokada and it blocked...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found