You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unwrap Context in order to retrieve Activity subclass (#59)
This fixes crash on Expo client which is wrapping Activity prior to passing it as a context to the root view.
After my recent change in the logic on how we access main activity we know extract the reference to it using `getContext` from the root view. Previously we were using `getTopLevelActivity` which wasn't working well in the cases where other non-react-native activities were transitioning in or out. The new approach however turned out not to be the best as for example expo client does not pass activity instance as a context directly to the root view. Instead the activity class is wrapped in ContextThemeWrapper ([see it here](https://github.com/expo/expo/blame/41458d1de91544c41097818db21e44e9aa84688c/android/expoview/src/main/java/versioned/host/exp/exponent/ReactUnthemedRootView.java#L13)).
We now try to unwrap the context if it is not a fragment activity using `getBaseContext`
This fixesexpo/expo#3191
0 commit comments