plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Request]: Specify Intent.FLAG_ACTIVITY_NEW_TASK for sharing

Open micahmo opened this issue 2 years ago • 1 comments

Plugin

share_plus

Use case

I am experiencing a behavior where sharing via the Android share sheet causes the target app to be displayed it the same app switcher entry as the originating app. From my research, this is because the sharing intent is not created with the Intent.FLAG_ACTIVITY_NEW_TASK flag. If we could optionally (or always) pass this flag when sharing, I believe that would make the flow much more intuitive for users.

Proposal

Have an option to (or just always) set Intent.FLAG_ACTIVITY_NEW_TASK when creating the share intent on Android.

Expected behavior

This is sharing from Keep to Drive, and it works as expected.

https://github.com/fluttercommunity/plus_plugins/assets/7417301/3fc7a343-7d9e-4de5-a52b-863ec66a7a07

Current behavior

This is sharing from Thunder (which uses share_plus) to Drive, and it does not work as expected.

https://github.com/fluttercommunity/plus_plugins/assets/7417301/0ec0877f-ba8b-47ac-a2b9-b351f1ccb1ec

micahmo avatar Oct 15 '23 03:10 micahmo

Thanks for suggesting. Indeed looks useful, even though I more often see apps doing sharing in the same task (for example, Twitter). But I like the idea or providing developers with choice.

vbuberen avatar Oct 15 '23 09:10 vbuberen