From c0a2c96d9bcc28604db1d328f8495e50ca4134c8 Mon Sep 17 00:00:00 2001 From: David Sandor Date: Sun, 18 Oct 2015 15:55:21 -0500 Subject: [PATCH] Clarified ReactInstanceManager paragraph. --- docs/NativeModulesAndroid.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/NativeModulesAndroid.md b/docs/NativeModulesAndroid.md index e6fabbb82..588157599 100644 --- a/docs/NativeModulesAndroid.md +++ b/docs/NativeModulesAndroid.md @@ -106,14 +106,17 @@ class AnExampleReactPackage implements ReactPackage { } ``` -The package needs to be provided to the ReactInstanceManager when it is built. See `UIExplorerActivity.java` for an example. The default package when you initialize a new project is `MainReactPackage.java`. +The package needs to be provided to the **ReactInstanceManager** when it is built. To accomplish this you will need to insert an `.addPackage(new YourPackageName())` call to the `mReactInstanceManager = ReactInstanceManager.builder()` call chain. + +Refer to the code below and add the `addPackage` statement to your application's `MainActivity.java` file. This file exists under the android folder in your react-native application directory. The path to this file is: `android/app/src/main/java/com/your-app-name/MainActivity.java`. + ```java mReactInstanceManager = ReactInstanceManager.builder() .setApplication(getApplication()) .setBundleAssetName("AnExampleApp.android.bundle") .setJSMainModuleName("Examples/AnExampleApp/AnExampleApp.android") - .addPackage(new AnExampleReactPackage()) + .addPackage(new AnExampleReactPackage()) // <-- Add this line with your package name. .setUseDeveloperSupport(true) .setInitialLifecycleState(LifecycleState.RESUMED) .build();