Refactor: Code Cleanup

Signed-off-by: HeCodes2Much <wayne6324@gmail.com>
This commit is contained in:
HeCodes2Much
2024-07-29 17:14:31 +01:00
parent acc34b28ac
commit a9e55e2fbe
2 changed files with 3 additions and 0 deletions

View File

@@ -39,6 +39,8 @@
android:supportsRtl="true"
android:theme="@style/Theme.Launcher"
android:enableOnBackInvokedCallback="true"
android:launchMode="singleTop"
android:clearTaskOnLaunch="true"
tools:targetApi="tiramisu">
<activity
android:name=".ui.activities.LauncherActivity"

View File

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