3

if device mode is dark mode then how to forced to our android App UI select light mode .. in my app background is white and text color is black , but in some devices dark mode is enable then background is show as black and text color is also black . how we forced android app to light mode

Naeem Ullah
  • 43
  • 1
  • 3
  • Does this answer your question? https://stackoverflow.com/questions/63777438/how-to-avoid-forced-dark-theme-in-my-app-when-devices-can-force-it-at-app-level – null_override Nov 03 '20 at 05:45

1 Answers1

9

Paste this line of code in Application class or Splash class

(you can write it in any class which is first to launch as app is opened)

AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);

Umair Iqbal
  • 1,959
  • 1
  • 19
  • 38