Skip to content

Commit

Permalink
fix: Runtime error when starting App from Widget on Android 15 (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paitomax authored Feb 6, 2025
1 parent 02c9f2f commit 64a38eb
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ object HomeWidgetLaunchIntent {
}

val options = ActivityOptions.makeBasic()
options.pendingIntentBackgroundActivityStartMode =
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED
if (Build.VERSION.SDK_INT >= 35) {
options.setPendingIntentCreatorBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED)
} else if (Build.VERSION.SDK_INT >= 34) {
options.pendingIntentBackgroundActivityStartMode =
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED
}

return PendingIntent.getActivity(context, 0, intent, flags, options.toBundle())
}
Expand Down

0 comments on commit 64a38eb

Please sign in to comment.