|
@@ -1,5 +1,7 @@
|
1
|
1
|
package com.reactnativenavigation.controllers;
|
2
|
2
|
|
|
3
|
+import android.app.Activity;
|
|
4
|
+import android.content.Intent;
|
3
|
5
|
import android.graphics.Color;
|
4
|
6
|
import android.os.Bundle;
|
5
|
7
|
import android.support.annotation.LayoutRes;
|
|
@@ -13,6 +15,17 @@ import com.reactnativenavigation.react.ReactDevPermission;
|
13
|
15
|
public abstract class SplashActivity extends AppCompatActivity {
|
14
|
16
|
public static boolean isResumed = false;
|
15
|
17
|
|
|
18
|
+ public static void start(Activity activity) {
|
|
19
|
+ Intent intent = activity.getPackageManager().getLaunchIntentForPackage(activity.getPackageName());
|
|
20
|
+ if (intent == null) return;
|
|
21
|
+ intent.setAction(Intent.ACTION_MAIN);
|
|
22
|
+ intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
|
23
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
24
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
|
25
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
26
|
+ activity.startActivity(intent);
|
|
27
|
+ }
|
|
28
|
+
|
16
|
29
|
@Override
|
17
|
30
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
18
|
31
|
super.onCreate(savedInstanceState);
|