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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving text opens inside another app on some devices #299

Open
marekhalmo opened this issue May 17, 2024 · 3 comments
Open

Receiving text opens inside another app on some devices #299

marekhalmo opened this issue May 17, 2024 · 3 comments

Comments

@marekhalmo
Copy link

Consider an application which stores your copy text stack.
The app would receive share text intent and add it to the app's list.

User would go to app A (let's say a browser).. select text, share it to this app (B). Text would be added to the list inside of app (B)

On some devices -> my app (B) opens inside the app (A) - insade task of A

What i want it to do is to push the data to an already running instance of app (B).

I tried to put singleTop, singleInstance e.t.c. to AndroidManifest but no luck.

It works on Android Emulator for Pixel3a (Android 14), and my Android 8 tablet,
but does not work on all other real android devices that i own < Android 13, 10, 11

Any idea why?

@marekhalmo
Copy link
Author

Application i start it with is always chrome - address bar

@marekhalmo
Copy link
Author

marekhalmo commented May 17, 2024

New information

It seems like where it goes OK, it comes from ReceiveSharingIntent.getTextStream() listener - when the app was already opened before, or ReceiveSharingIntent.getTextStream() if it was not opened

If my app (B) opens inside of (A) - the event commes from ReceiveSharingIntent.getTextStream() future - every time

@marekhalmo
Copy link
Author

Looks like the problem is that when it works -> the intent is started with "startActivity" vs if it does not it is launched with "startActivityWithResult"

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

No branches or pull requests

1 participant