0

I'm trying to send and intent which contains a String. I want to share this intent implicitly, so I don't want to specify the app who will receive this Intent.

Let me explain, the string I want to send will be send thank's to the Intent, and in the same app put in the clipboard, and then I paste the clipboard thank's to AccessibilityService in another app. The intent will serve to be catches first by the clipboard, and then by another app (with a script code to this intent, because the app is too already created but can't be edited.

So I started to do this :

Intent intent = new Intent();
                intent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
                intent.setType("text/plain");
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(intent);

from the developer.android site, but it open a menu in which I must chose an app to share the intent, that's what I won't.

Could you help be?

NOTE: I'm French, sorry for my poor English

Hemant Parmar
  • 3,924
  • 7
  • 25
  • 49
  • Possible duplicate of [Send string to another Android application](https://stackoverflow.com/questions/14683041/send-string-to-another-android-application) – Anthony Cannon May 16 '18 at 11:27
  • https://stackoverflow.com/questions/5745243/data-sharing-between-two-applications Please Follow this link. – Hitesh Manwani May 16 '18 at 11:30
  • 1
    `I want to share this intent implicitly, so I don't want to specify the app who will receive this Intent.`. ,Ok. So then the user has to choose an app. `I must chose an app to share the intent, that's what I won't.` ?? That is contradictory. – greenapps May 16 '18 at 11:32
  • 1
    I'm pretty amazed that your intent would display something to choose. – greenapps May 16 '18 at 11:34
  • a `startActivity` intent is only handled by 1 app, it's not shared. That needs a broadcast intent. An app also has to have the right type of intent filter in the manifest to receive the intent: https://developer.android.com/guide/components/intents-filters (in case of your intent probably something like `` in the manifest). I don't think you're on the right track with your approach but it's unclear to me what you're trying. – zapl May 16 '18 at 11:38
  • @greenapps, when I said I must choose an app, it's because the code open an Menu in which there apps who could receive this Intent, but I don't want menu show up.... – Nathanael Heitz May 16 '18 at 11:47
  • Thank's for reply @AnthonyCannon I tried what was indicated but don't work.. that's not what I want :/ – Nathanael Heitz May 16 '18 at 12:23
  • Thank's @HiteshManwani, I tried to do understand how does Content Providers work, but I don't understand – Nathanael Heitz May 16 '18 at 12:27
  • Thank's @zapl, but it don't solve my problem – Nathanael Heitz May 16 '18 at 12:28

0 Answers0