mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-22 00:42:38 +00:00
add restart with safe mode util
This commit is contained in:
2 files changed
+10
-2
No files matched your search
@@ -191,10 +191,16 @@ object GeodeUtils {
|
||||
|
||||
@JvmStatic
|
||||
fun restartGame() {
|
||||
restartGame(true)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun restartGame(safeMode: Boolean) {
|
||||
activity.get()?.run {
|
||||
packageManager.getLaunchIntentForPackage(packageName)?.also {
|
||||
val mainIntent = Intent.makeRestartActivityTask(it.component)
|
||||
mainIntent.putExtra("restarted", true)
|
||||
mainIntent.putExtra("safe-mode", safeMode)
|
||||
startActivity(mainIntent)
|
||||
exitProcess(0)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user