Skip to content

Instantly share code, notes, and snippets.

@bkhezry
Created February 2, 2020 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkhezry/21b3db664225d4f351729a73396dcbf6 to your computer and use it in GitHub Desktop.
Save bkhezry/21b3db664225d4f351729a73396dcbf6 to your computer and use it in GitHub Desktop.
Fix dark mode problem with i18n
@Override
public void applyOverrideConfiguration(@Nullable Configuration overrideConfiguration) {
if (overrideConfiguration != null) {
int uiMode = overrideConfiguration.uiMode;
overrideConfiguration.setTo(getBaseContext().getResources().getConfiguration());
overrideConfiguration.uiMode = uiMode;
}
super.applyOverrideConfiguration(getResources().getConfiguration());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment