List of usage examples for com.facebook.react ReactRootView startReactApplication
public void startReactApplication(ReactInstanceManager reactInstanceManager, String moduleName, @Nullable Bundle initialProperties)
From source file:com.github.markzhai.react.preloader.ReactPreLoader.java
License:Apache License
/** * Pre-load {@link ReactRootView} to local {@link Map}, you may want to * load it in previous activity./*from w ww . ja v a 2 s . c o m*/ */ public static void init(Activity activity, ReactInfo reactInfo) { if (CACHE_VIEW_MAP.get(reactInfo.getMainComponentName()) != null) { return; } ReactRootView rootView = new ReactRootView(new MutableContextWrapper(activity)); rootView.startReactApplication( ((ReactApplication) activity.getApplication()).getReactNativeHost().getReactInstanceManager(), reactInfo.getMainComponentName(), reactInfo.getLaunchOptions()); CACHE_VIEW_MAP.put(reactInfo.getMainComponentName(), rootView); }