-
-
Save wiyarmir/008a8f5e0db62eba43f9f3cf601e5b09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private String currentLocale; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
currentLocale = getResources().getConfiguration().locale.toString(); | |
} | |
@Override | |
public void onConfigurationChanged(Configuration newConfig) { | |
super.onConfigurationChanged(newConfig); | |
String newLocale = newConfig.locale.toString(); | |
if (currentLocale.equals(newLocale)) { | |
return; | |
} | |
currentLocale = newLocale; | |
final ReactInstanceManager instanceManager = getReactInstanceManager(); | |
instanceManager.recreateReactContextInBackground(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment