From 351437449333d6548c55f326fbfce01775e9b43b Mon Sep 17 00:00:00 2001 From: Jeduan Cornejo Date: Mon, 22 Feb 2016 12:35:46 -0600 Subject: [PATCH] Updates Android install documentation I just went through the installation on an Android sample app and noticed that React Native's Java code looks different now. I updated the documentation to reflect the latest version and tested it on a sample application created with react-native 0.20. Hope this will be useful. --- README.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f04c2e9..e24ef24 100644 --- a/README.md +++ b/README.md @@ -45,28 +45,16 @@ dependencies { ```java import com.rnfs.RNFSPackage; // <--- import -public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { +public class MainActivity extends ReactActivity { ...... @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - mReactRootView = new ReactRootView(this); - - mReactInstanceManager = ReactInstanceManager.builder() - .setApplication(getApplication()) - .setBundleAssetName("index.android.bundle") - .setJSMainModuleName("index.android") - .addPackage(new MainReactPackage()) - .addPackage(new RNFSPackage()) // <------- add package - .setUseDeveloperSupport(BuildConfig.DEBUG) - .setInitialLifecycleState(LifecycleState.RESUMED) - .build(); - - mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null); - - setContentView(mReactRootView); + protected List getPackages() { + return Arrays.asList( + new MainReactPackage(), + new RNFSPackage // <-- add package + ) } ......