1. React Naitve启动顺(Android)
- ReactActivity->onCreate()
- MainApplication->mReactNativeHost.getPackages()
- ScannerPackage->Scanner.initScannerModule 所以在ReactActivity->onCreate()中取不到ScannerModule.getInstance(),是在mCreateReactContextThread异步加载Packages.
https://www.jianshu.com/p/af4cb096785b
ReactActivity—>
ReactActivityDelegate—>
createRootView->
getReactNativeHost->
createReactInstanceManager->ReactInstanceManagerImpl
recreateReactContextInBackground->
1.构造ReactContext->
2.加载CoreModulesPackage->
3.加载用户自定义Packages->
4.构造CatalystInstanceImpl->
5.runJSBundle
setContentView(mReactRootView)