Created
January 22, 2020 15:49
-
-
Save ferrannp/277e234eaa0f742b7ea2da909d8734f0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// RNSplashScreenModule.java | |
import android.app.Activity; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
import com.facebook.react.bridge.ReactMethod; | |
import javax.annotation.Nonnull; | |
public class RNSplashScreenModule extends ReactContextBaseJavaModule { | |
RNSplashScreenModule(ReactApplicationContext reactContext) { | |
super(reactContext); | |
} | |
@Nonnull | |
@Override | |
public String getName() { | |
return "RNSplashScreen"; | |
} | |
@ReactMethod | |
public void hide() { | |
final Activity activity = getCurrentActivity(); | |
if (activity != null) { | |
activity.runOnUiThread(((MainActivity) activity)::switchToReactView); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment