|
7 | 7 |
|
8 | 8 | package com.facebook.react.modules.dialog;
|
9 | 9 |
|
10 |
| -import javax.annotation.Nullable; |
11 |
| - |
12 |
| -import java.util.Map; |
13 |
| - |
14 | 10 | import android.app.Activity;
|
15 | 11 | import android.content.DialogInterface;
|
16 | 12 | import android.content.DialogInterface.OnClickListener;
|
17 | 13 | import android.content.DialogInterface.OnDismissListener;
|
18 | 14 | import android.os.Bundle;
|
19 | 15 | import android.support.v4.app.FragmentActivity;
|
20 |
| - |
21 | 16 | import com.facebook.common.logging.FLog;
|
22 | 17 | import com.facebook.react.bridge.Callback;
|
23 | 18 | import com.facebook.react.bridge.LifecycleEventListener;
|
|
29 | 24 | import com.facebook.react.bridge.UiThreadUtil;
|
30 | 25 | import com.facebook.react.common.MapBuilder;
|
31 | 26 | import com.facebook.react.module.annotations.ReactModule;
|
| 27 | +import java.util.Map; |
| 28 | +import javax.annotation.Nullable; |
32 | 29 |
|
33 | 30 | @ReactModule(name = DialogModule.NAME)
|
34 | 31 | public class DialogModule extends ReactContextBaseJavaModule implements LifecycleEventListener {
|
@@ -110,13 +107,13 @@ private void dismissExisting() {
|
110 | 107 | if (isUsingSupportLibrary()) {
|
111 | 108 | SupportAlertFragment oldFragment =
|
112 | 109 | (SupportAlertFragment) mSupportFragmentManager.findFragmentByTag(FRAGMENT_TAG);
|
113 |
| - if (oldFragment != null) { |
| 110 | + if (oldFragment != null && oldFragment.isResumed()) { |
114 | 111 | oldFragment.dismiss();
|
115 | 112 | }
|
116 | 113 | } else {
|
117 | 114 | AlertFragment oldFragment =
|
118 | 115 | (AlertFragment) mFragmentManager.findFragmentByTag(FRAGMENT_TAG);
|
119 |
| - if (oldFragment != null) { |
| 116 | + if (oldFragment != null && oldFragment.isResumed()) { |
120 | 117 | oldFragment.dismiss();
|
121 | 118 | }
|
122 | 119 | }
|
|
0 commit comments