Skip to content

Conversation

@steff-mueller
Copy link

Prevent destroying ReactNativeActivity or ReactNativeTabActivity on runtime changes (http://developer.android.com/guide/topics/resources/runtime-changes.html)

I noticed that the example included in this repo crashes on screen rotation because Android destroys and re-creates the ReactNativeTabActivity. Android remembers the TabViews which were created before the rotation and adds them back itself - resulting in duplicate TabViews, forcing the app to crash because the maximum allowed items for a menu (java.lang.IllegalArgumentException: Maximum number of items supported by BottomNavigationView is 5.) is exceeded.

I am not sure if you really want to merge these changes in and if there are dangerous implications. At least this is considered "default" by react-native: https://github.com/facebook/react-native/blob/master/local-cli/templates/HelloWorld/android/app/src/main/AndroidManifest.xml#L22

@lelandrichardson
Copy link
Collaborator

@gpeal what are your thoughts on this? Is there a more "correct" way of doing this?

@gpeal
Copy link
Collaborator

gpeal commented May 26, 2017

@lelandrichardson Fwiw, we added "orientation|screenSize" to the Airbnb app.

I think that's correct to add here. You don't want the keybaord ones though.

@gpeal
Copy link
Collaborator

gpeal commented May 26, 2017

@Arxisos ^

@henrikra
Copy link

@gpeal or @lelandrichardson Can't you guys finish off this branch since it is so simple :D?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants