From 751ef8fcfae65b93cd7905edcc51aa49cef79788 Mon Sep 17 00:00:00 2001 From: Luca Pezzolla Date: Wed, 11 Oct 2023 15:50:01 +0200 Subject: [PATCH] fix: prevent crashes on Android when an Activity is restarted Closes #302 --- .../app/src/main/java/it/polito/students/MainActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/app/src/main/java/it/polito/students/MainActivity.java b/android/app/src/main/java/it/polito/students/MainActivity.java index 1094df63..fd37a444 100644 --- a/android/app/src/main/java/it/polito/students/MainActivity.java +++ b/android/app/src/main/java/it/polito/students/MainActivity.java @@ -1,5 +1,6 @@ package it.polito.students; +import android.os.Bundle; import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivityDelegate; import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint; @@ -7,6 +8,11 @@ public class MainActivity extends ReactActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(null); + } + // @Override // public void onConfigurationChanged(Configuration newConfig) { // super.onConfigurationChanged(newConfig);