Created
June 24, 2020 12:14
-
-
Save soolaugust/033d2649d784cab33634e1e395c6c93c to your computer and use it in GitHub Desktop.
Android重启
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RestartApp { | |
public static void restartApp(Context context) { | |
Intent intent = new Intent(context, SplashActivity.class); | |
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
context.startActivity(intent); | |
android.os.Process.killProcess(android.os.Process.myPid()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment