You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rn-splash-screen working fine on both android & ios but on "Android" splash screen comes while starting of the app but on reloading it showing white screen.
changed part is in Bold : /rn-splash-screen/android/src/main/java/com/mehcode/reactnative/splashscreen/SplashScreenPackage.java The file contains:
package com.mehcode.reactnative.splashscreen;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.v4.content.LocalBroadcastManager; import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class SplashScreenPackage implements ReactPackage { @OverRide
public List<Class<? extends JavaScriptModule>> createJSModules() {
return Collections.emptyList();
} @OverRide
public List createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
} @OverRide
public List createNativeModules(
ReactApplicationContext reactContext) {
List modules = new ArrayList<>();
modules.add(new SplashScreenModule(reactContext));
return modules;
}
}
And MainActivity.java contains:
package social.xyz.app;
import com.facebook.react.ReactActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.mehcode.reactnative.splashscreen.SplashScreen;
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 void onCreate(Bundle savedInstanceState) {
// Show the js-controlled splash screen
SplashScreen.show(this, getReactInstanceManager());
super.onCreate(savedInstanceState);
} @OverRide
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data);
} @OverRide
protected String getMainComponentName() {
return "xyz";
}
}
rn-splash-screen working fine on both android & ios but on "Android" splash screen comes while starting of the app but on reloading it showing white screen.
react-native: 0.45.1
rn-splash-screen: It's forked repo.
changed part is in Bold : /rn-splash-screen/android/src/main/java/com/mehcode/reactnative/splashscreen/SplashScreenPackage.java The file contains:
And MainActivity.java contains:
@mehcode please have a look at this.
The text was updated successfully, but these errors were encountered: