Skip to content

Instantly share code, notes, and snippets.

@joaquin-viera
Created January 8, 2021 02:20
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 joaquin-viera/fc77932532eea6fe42e9fc0a8d02eaaa to your computer and use it in GitHub Desktop.
Save joaquin-viera/fc77932532eea6fe42e9fc0a8d02eaaa to your computer and use it in GitHub Desktop.
Landscape Orientation - MainActivity.java
// ...
+import android.content.Intent;
+import android.content.res.Configuration;
public class MainActivity extends ReactActivity {
+ @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