Skip to content

Instantly share code, notes, and snippets.

@janhesters
Created September 17, 2018 15:24
Show Gist options
  • Save janhesters/1de14fe326d6241c3056de9e9ddf8991 to your computer and use it in GitHub Desktop.
Save janhesters/1de14fe326d6241c3056de9e9ddf8991 to your computer and use it in GitHub Desktop.
// ... Other imports
import android.content.Intent;
import android.content.res.Configuration;
public class MainActivity extends ReactActivity {
// ... Leave the default code from React Native untouched
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Intent intent = new Intent("onConfigurationChanged");
intent.putExtra("newConfig", newConfig);
this.sendBroadcast(intent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment