Skip to content

Instantly share code, notes, and snippets.

@soolaugust
Created June 24, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soolaugust/033d2649d784cab33634e1e395c6c93c to your computer and use it in GitHub Desktop.
Save soolaugust/033d2649d784cab33634e1e395c6c93c to your computer and use it in GitHub Desktop.
Android重启
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