- Update the Android setup documentation (no code changes). It's now recommended to use
onCreate
instead ofloadApp
to initreact-native-bootsplash
as soon as possible (fix #379):
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
+ import android.os.Bundle;
import com.zoontek.rnbootsplash.RNBootSplash;
public class MainActivity extends ReactActivity {
// …
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ RNBootSplash.init(this); // <- initialize the splash screen
+ super.onCreate(savedInstanceState); // or super.onCreate(null) with react-native-screens
+ }
public static class MainActivityDelegate extends ReactActivityDelegate {
// …
- @Override
- protected void loadApp(String appKey) {
- RNBootSplash.init(getPlainActivity()); // <- initialize the splash screen
- super.loadApp(appKey);
- }
}
}