From 6c07ad2377d7a04ed8fe1a01648ad5637476b914 Mon Sep 17 00:00:00 2001 From: jinchung Date: Sat, 7 Oct 2023 10:43:10 -0400 Subject: [PATCH] Fix crashes resulting from react-native-screens Activity restart on Android As per the react-native-screens documentation on Android setup: Discards any Activity state persisted during the Activity restart process, to avoid inconsistencies that lead to crashes. --- android/app/src/main/java/me/rainbow/MainActivity.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/app/src/main/java/me/rainbow/MainActivity.java b/android/app/src/main/java/me/rainbow/MainActivity.java index 6a328e75a0e..f1369e155cb 100644 --- a/android/app/src/main/java/me/rainbow/MainActivity.java +++ b/android/app/src/main/java/me/rainbow/MainActivity.java @@ -10,7 +10,6 @@ import me.rainbow.NativeModules.RNBackHandler.RNBackHandlerPackage; import me.rainbow.NativeModules.Internals.*; import android.webkit.WebView; -import com.facebook.react.ReactActivityDelegate; import com.zoontek.rnbootsplash.RNBootSplash; import android.content.Intent; @@ -19,7 +18,7 @@ public class MainActivity extends ReactActivity { @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + super.onCreate(null); WebView.setWebContentsDebuggingEnabled(false); }