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