Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
android.os.Process.killProcess(android.os.Process.myPid());
本文介绍了一种在Android应用中重启Home Activity并随后关闭整个应用的方法。通过设置Intent的Action、Category以及Flags来实现这一目标。
1064

被折叠的 条评论
为什么被折叠?



