From b2459cc01c52c514e9ecb94da4fec162585ac7f4 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Thu, 17 Jan 2019 11:20:52 -0800 Subject: [PATCH] Fix [FB4A] DialogModule.showNewAlert Summary: Check that the Fragment Manager has not called `onSaveInstanceState` before attempting to show the DialogFragment. See: https://developer.android.com/reference/android/support/v4/app/FragmentManager#isstatesaved Reviewed By: mdvacca Differential Revision: D13686425 fbshipit-source-id: 090a88aa6f892c961b1c49a2bffe603c38528b8a --- .../java/com/facebook/react/modules/dialog/DialogModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.java index 840028c50..19400d897 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/dialog/DialogModule.java @@ -129,7 +129,7 @@ public class DialogModule extends ReactContextBaseJavaModule implements Lifecycl if (isUsingSupportLibrary()) { SupportAlertFragment alertFragment = new SupportAlertFragment(actionListener, arguments); - if (isInForeground) { + if (isInForeground && !mSupportFragmentManager.isStateSaved()) { if (arguments.containsKey(KEY_CANCELABLE)) { alertFragment.setCancelable(arguments.getBoolean(KEY_CANCELABLE)); }