Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share plugin has weird behavior on Android #1466

Open
diesieben07 opened this issue Mar 8, 2023 · 0 comments
Open

Share plugin has weird behavior on Android #1466

diesieben07 opened this issue Mar 8, 2023 · 0 comments

Comments

@diesieben07
Copy link

Bug Report

Plugin(s)

Share

Capacitor Version

馃拪   Capacitor Doctor  馃拪 

Latest Dependencies:

  @capacitor/cli: 4.7.0
  @capacitor/core: 4.7.0
  @capacitor/android: 4.7.0
  @capacitor/ios: 4.7.0

Installed Dependencies:

  @capacitor/cli: 4.5.0
  @capacitor/core: 4.5.0
  @capacitor/ios: 4.5.0
  @capacitor/android: 4.5.0

Platform(s)

Android

Current Behavior

When sharing content using the Share plugin, the target app's activity is opened within the context of the source app, leading to very confusing UI behavior:

  • In the task overview ("list of open apps"), the target app and the source app are not separate. The target app is not shown as its own entry, instead its activity is shown as if it was part of the source app
  • If the target app was already open when sharing, it now seems to appear twice in the task overview, due to the issue above.
  • To return to the source app after sharing, the user must use the back button/gesture of the device to step through the history of the target app before then returning to the source app

Expected Behavior

When sharing, the target app should be started as a new task.

Code Reproduction

Share.share({
  title: "Share test",
  text: "I am sharing this text"
});

Additional Context

To fix this, the sharing Intent should be created with the Intent.FLAG_ACTIVITY_NEW_TASK) flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants