mirror of
https://github.com/anultravioletaurora/Jellify.git
synced 2025-12-30 10:20:00 -06:00
Fix: Pass null to super.onCreate to prevent react-native-screens fragment restoration crash. (#812)
* Fix: Pass null to super.onCreate to prevent react-native-screens fragment restoration crash on android * feat: implement RNScreensFragmentFactory for proper fragment restoration and remove previous workaround. --------- Co-authored-by: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import com.facebook.react.defaults.DefaultReactActivityDelegate
|
||||
import com.reactnative.googlecast.api.RNGCCastContext
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.Nullable
|
||||
import com.swmansion.rnscreens.fragment.restoration.RNScreensFragmentFactory
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +28,9 @@ class MainActivity : ReactActivity() {
|
||||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
||||
|
||||
|
||||
override fun onCreate(@Nullable savedInstanceState: Bundle?) {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
// react-native-screens fragment factory for proper fragment restoration
|
||||
supportFragmentManager.fragmentFactory = RNScreensFragmentFactory()
|
||||
super.onCreate(savedInstanceState)
|
||||
// lazy load Google Cast context (if supported on this device)
|
||||
RNGCCastContext.getSharedInstance(this)
|
||||
|
||||
Reference in New Issue
Block a user