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
This commit is contained in:
Luna Wei
2019-01-17 11:20:52 -08:00
committed by Facebook Github Bot
parent b0db2d71b9
commit b2459cc01c

View File

@@ -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));
}