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
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<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNFSPackage // <-- add package
)
}
......