mirror of
https://github.com/status-im/react-native-fs.git
synced 2025-02-28 23:10:29 +00:00
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:
parent
06bdba89fa
commit
3514374493
24
README.md
24
README.md
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
......
|
......
|
||||||
|
Loading…
x
Reference in New Issue
Block a user