Created
January 8, 2022 18:55
-
-
Save parth-koshta/346744ceb684d311d8ee7f78b0b97013 to your computer and use it in GitHub Desktop.
Medium article - splash screen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.rn_base; | |
import com.facebook.react.ReactActivity; | |
import com.facebook.react.ReactActivityDelegate; // add this line | |
import com.zoontek.rnbootsplash.RNBootSplash; // add this line | |
public class MainActivity extends ReactActivity { | |
// ... | |
/** | |
* This is added for react-native-bootsplash | |
*/ | |
@Override | |
protected ReactActivityDelegate createReactActivityDelegate() { | |
return new ReactActivityDelegate(this, getMainComponentName()) { | |
@Override | |
protected void loadApp(String appKey) { | |
RNBootSplash.init(MainActivity.this); // <- initialize the splash screen | |
super.loadApp(appKey); | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment