googlevr / gvr-android-sdk

Google VR SDK for Android
http://developers.google.com/vr/android/
Other
3.28k stars 1.28k forks source link

Toggling AndroidCompat.setVrModeEnabled On then Off destroys the Activity #554

Closed achuvm closed 6 years ago

achuvm commented 6 years ago

We're using the following API to properly handle Daydream and GVR experiences:

https://developers.google.com/vr/reference/android/com/google/vr/sdk/base/AndroidCompat#setVrModeEnabled(android.app.Activity,%20boolean)

However, calling setVrModeEnabled(activity, false) causes the activity to be destroyed. This happens after we want to exit the VR experience, but remain in the Activity (through React Native which uses the 1 Activity).

Thanks,

jdduke commented 6 years ago

Hi @achuvm, can you try adding uiMode to the android:configChanges attribute in your manifest?

achuvm commented 6 years ago

Hi @jdduke,

Ahh that works! Thanks!