File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
android/src/main/kotlin/com/pravera/flutter_foreground_task/utils Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.pravera.flutter_foreground_task.utils
33import android.app.Activity
44import android.app.ActivityManager
55import android.app.ActivityManager.RunningAppProcessInfo
6+ import android.app.ActivityOptions
67import android.app.AlarmManager
78import android.content.Context
89import android.content.Intent
@@ -52,7 +53,16 @@ class PluginUtils {
5253 if (route != null ) {
5354 launchIntent.putExtra(" route" , route)
5455 }
55- context.startActivity(launchIntent)
56+
57+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .UPSIDE_DOWN_CAKE ) {
58+ val options = ActivityOptions .makeBasic().apply {
59+ pendingIntentBackgroundActivityStartMode =
60+ ActivityOptions .MODE_BACKGROUND_ACTIVITY_START_ALLOWED
61+ }
62+ context.startActivity(launchIntent, options.toBundle())
63+ } else {
64+ context.startActivity(launchIntent)
65+ }
5666 }
5767 }
5868
You can’t perform that action at this time.
0 commit comments