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.
This commit is contained in:
Jeduan Cornejo 2016-02-22 12:35:46 -06:00
parent 06bdba89fa
commit 3514374493

View File

@ -45,28 +45,16 @@ dependencies {
```java ```java
import com.rnfs.RNFSPackage; // <--- import import com.rnfs.RNFSPackage; // <--- import
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { public class MainActivity extends ReactActivity {
...... ......
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected List<ReactPackage> getPackages() {
super.onCreate(savedInstanceState); return Arrays.<ReactPackage>asList(
mReactRootView = new ReactRootView(this); new MainReactPackage(),
new RNFSPackage // <-- add package
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);
} }
...... ......