mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Check if mCurrentActivity is set according to LifecycleState (#23336)
Summary: Issues: Related to #13439 react-native-website:Related to PR [#792](https://github.com/facebook/react-native-website/pull/792) solution: https://github.com/facebook/react-native/issues/13439#issuecomment-400256114 When we integration with Existing Android Apps.and set LifecycleState is `LifecycleState.RESUMED`. It's lead to `mCurrentActivity` is null . At this time , the behave of set `mCurrentActivity ` which is unexpectedly. ## Changelog [Android] [Fixed] - Check if mCurrentActivity is set according to LifecycleState Pull Request resolved: https://github.com/facebook/react-native/pull/23336 Differential Revision: D14298654 Pulled By: cpojer fbshipit-source-id: 5cc17539a51154faeb838349b068d92511946f79
This commit is contained in:
committed by
Facebook Github Bot
parent
38adb8ecd2
commit
fb550e9e84
@@ -246,6 +246,12 @@ public class ReactInstanceManagerBuilder {
|
||||
mApplication,
|
||||
"Application property has not been set with this builder");
|
||||
|
||||
if (mInitialLifecycleState == LifecycleState.RESUMED) {
|
||||
Assertions.assertNotNull(
|
||||
mCurrentActivity,
|
||||
"Activity needs to be set if initial lifecycle state is resumed");
|
||||
}
|
||||
|
||||
Assertions.assertCondition(
|
||||
mUseDeveloperSupport || mJSBundleAssetUrl != null || mJSBundleLoader != null,
|
||||
"JS Bundle File or Asset URL has to be provided when dev support is disabled");
|
||||
|
||||
Reference in New Issue
Block a user