mirror of
https://github.com/status-im/react-native.git
synced 2025-03-03 19:00:37 +00:00
Summary: Having a base activity allows us to add new features and fixes without having to change the generated `MainActivity` file. cc mkonicek arbesfeld Closes https://github.com/facebook/react-native/pull/4827 Reviewed By: bestander Differential Revision: D2783527 Pulled By: mkonicek fb-gh-sync-id: 707b82839809ca2e1775f5d3ac022a6d00bcac5a
36 lines
933 B
Java
36 lines
933 B
Java
package <%= package %>;
|
|
|
|
import com.facebook.react.ReactActivity;
|
|
import com.facebook.react.shell.MainReactPackage;
|
|
|
|
public class MainActivity extends ReactActivity {
|
|
|
|
/**
|
|
* Returns the name of the main component registered from JavaScript.
|
|
* This is used to schedule rendering of the component.
|
|
*/
|
|
@Override
|
|
protected String getMainComponentName() {
|
|
return "<%= name %>";
|
|
}
|
|
|
|
/**
|
|
* Returns whether dev mode should be enabled.
|
|
* This enables e.g. the dev menu.
|
|
*/
|
|
@Override
|
|
protected boolean getUseDeveloperSupport() {
|
|
return BuildConfig.DEBUG;
|
|
}
|
|
|
|
/**
|
|
* A list of packages used by the app. If the app uses additional views
|
|
* or modules besides the default ones, add more packages here.
|
|
*/
|
|
@Override
|
|
protected abstract List<ReactPackage> getPackages() {
|
|
return Arrays.<ReactPackage>asList(
|
|
new MainReactPackage());
|
|
}
|
|
}
|