Fix: Fixed restart app issue when restoring backup.
This commit is contained in:
@@ -12,11 +12,12 @@ object AppReloader {
|
||||
val componentName = intent?.component
|
||||
val mainIntent = Intent.makeRestartActivityTask(componentName)
|
||||
mainIntent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
|
||||
mainIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
|
||||
// Delay the restart slightly to ensure all current activities are finished
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
Handler(Looper.getMainLooper()).postDelayed({
|
||||
context.startActivity(mainIntent)
|
||||
Runtime.getRuntime().exit(0)
|
||||
}
|
||||
}, 250)
|
||||
}
|
||||
}
|
||||
@@ -391,9 +391,7 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
applicationContext.showShortToast(getString(R.string.settings_reload_app_restore))
|
||||
Handler(Looper.getMainLooper()).postDelayed({
|
||||
AppReloader.restartApp(applicationContext)
|
||||
}, 500)
|
||||
AppReloader.restartApp(applicationContext)
|
||||
}
|
||||
|
||||
Constants.BACKUP_WRITE -> {
|
||||
|
||||
Reference in New Issue
Block a user