-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
3.Update the MainApplication.java file to use react-native-splash-screen via the following changes:
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new SplashScreenReactPackage() //here
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}
Need to import
the package.
import com.cboy.rn.splashscreen.SplashScreenReactPackage;
Android:
Update the MainActivity.java file to use react-native-splash-screen via the following changes:
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this); // here
super.onCreate(savedInstanceState);
}
// ...other code
}
Also, need to import the package.
import com.cboy.rn.splashscreen.SplashScreen;
haikyuu
Metadata
Metadata
Assignees
Labels
No labels