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) {
7070 }
7171 activity = mActivity .get ();
7272 }
73+
7374 if (activity == null ) return ;
7475
75- activity .runOnUiThread (new Runnable () {
76+ final Activity _activity = activity ;
77+
78+ _activity .runOnUiThread (new Runnable () {
7679 @ Override
7780 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+ }
8091 mSplashDialog = null ;
8192 }
8293 }
You can’t perform that action at this time.
0 commit comments