Skip to content

Instantly share code, notes, and snippets.

@Titozzz
Last active January 31, 2019 00:57
Show Gist options
  • Save Titozzz/89f39d9ca3392236ad4c48a47a95f90c to your computer and use it in GitHub Desktop.
Save Titozzz/89f39d9ca3392236ad4c48a47a95f90c to your computer and use it in GitHub Desktop.
Clean MainApplication.java
package com.example;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment