react-native-orientation-locker icon indicating copy to clipboard operation
react-native-orientation-locker copied to clipboard

Android app crash when orientation change to landscape

Open raphaelPloomes opened this issue 4 years ago • 2 comments

When I call the Orientation.lockToLandscape() I have the following error:

error

If I start the app in landscape and switch to portrait, the error doesn't happen

My activity tag in AndroidManifest.xml : <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:launchMode="singleTask" android:exported="true">

Overriding the method in MainActivity.Java : @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); Intent intent = new Intent("onConfigurationChanged"); intent.putExtra("newConfig", newConfig); this.sendBroadcast(intent); }

react-native: 0.61.5 react-navigation: 2.12.1

Any solution?

raphaelPloomes avatar Feb 09 '21 19:02 raphaelPloomes

I am facing this issue too. Any progress from your side ?

silentashish avatar May 01 '21 09:05 silentashish

found a similar problem happens in Android SDK 30 (Android 11) but not Android 10

richso avatar Aug 06 '21 05:08 richso