Check for null config

This commit is contained in:
Miguel Alatzar 2019-07-12 08:56:36 -07:00
parent f5a9c7df81
commit c30bc8bfea
2 changed files with 6 additions and 5 deletions

View file

@ -127,10 +127,7 @@ public class MainApplication extends NavigationApplication implements INotificat
super.onCreate();
instance = this;
// TODO: Right now I get a black screen when resuming the app from the
// background if these callbacks are registered. I'm commenting this out
// to move forward and will come back to this at a later date.
//registerActivityLifecycleCallbacks(new ManagedActivityLifecycleCallbacks());
registerActivityLifecycleCallbacks(new ManagedActivityLifecycleCallbacks());
// Delete any previous temp files created by the app
File tempFolder = new File(getApplicationContext().getCacheDir(), "mmShare");

View file

@ -17,6 +17,7 @@ import java.util.Set;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
public class ManagedActivityLifecycleCallbacks implements ActivityLifecycleCallbacks {
@ -96,7 +97,10 @@ public class ManagedActivityLifecycleCallbacks implements ActivityLifecycleCallb
}
private void sendConfigChanged(Bundle config) {
Object result = Arguments.fromBundle(config);
WritableMap result = Arguments.createMap();
if (config != null) {
result = Arguments.fromBundle(config);
}
ReactContext ctx = MainApplication.instance.getRunningReactContext();
if (ctx != null) {