Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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