Fix: Fixed reload app bug.

Signed-off-by: HeCodes2Much <wayne6324@gmail.com>
This commit is contained in:
HeCodes2Much
2024-08-23 09:49:56 +01:00
parent ece8ebf809
commit ba5f5ef85c

View File

@@ -11,6 +11,7 @@ object AppReloader {
val intent = packageManager.getLaunchIntentForPackage(context.packageName)
val componentName = intent?.component
val mainIntent = Intent.makeRestartActivityTask(componentName)
mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
mainIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
// Delay the restart slightly to ensure all current activities are finished