File tree 1 file changed +14
-2
lines changed
android/src/main/java/org/devio/rn/splashscreen
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import android .app .Activity ;
4
4
import android .app .Dialog ;
5
+ import android .os .Build ;
5
6
6
7
import java .lang .ref .WeakReference ;
7
8
@@ -65,13 +66,24 @@ public static void hide(Activity activity) {
65
66
}
66
67
activity = mActivity .get ();
67
68
}
69
+
68
70
if (activity == null ) return ;
69
71
70
- activity .runOnUiThread (new Runnable () {
72
+ final Activity _activity = activity ;
73
+
74
+ _activity .runOnUiThread (new Runnable () {
71
75
@ Override
72
76
public void run () {
73
77
if (mSplashDialog != null && mSplashDialog .isShowing ()) {
74
- mSplashDialog .dismiss ();
78
+ boolean isDestroyed = false ;
79
+
80
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .JELLY_BEAN_MR1 ) {
81
+ isDestroyed = _activity .isDestroyed ();
82
+ }
83
+
84
+ if (!_activity .isFinishing () && !isDestroyed ) {
85
+ mSplashDialog .dismiss ();
86
+ }
75
87
mSplashDialog = null ;
76
88
}
77
89
}
You can’t perform that action at this time.
0 commit comments