-
Notifications
You must be signed in to change notification settings - Fork 4
Share Intent
Roman Tcaregorodtcev edited this page Mar 22, 2018
·
1 revision
Activity Action: Deliver some data to someone else. Who the data is being delivered to is not specified; it is up to the receiver of this action to ask the user where the data should be sent.
When launching a SEND intent, you should usually wrap it in a chooser (through createChooser(Intent, CharSequence)), which will give the proper interface for the user to pick how to send your data and allow you to specify a prompt indicating what they are doing.
OmegaIntentBuilder.from(context)
.share()
.emailTo("[email protected]")
.emailBcc("[email protected]","[email protected]") // Concealed addresses
.emailCc("[email protected]","[email protected]") // Copy addresses
.subject("Great library")
.createIntentHandler()
.chooserTitle("Choose")
.startActivity();
You can download file from internet and put it to intent.
OmegaIntentBuilder.from(context)
.share()
.emailTo("[email protected]")
.subject("Great library")
.filesUrls("https://developer.android.com/studio/images/hero_image_studio.png")
.fileUrlWithMimeType("https://avatars1.githubusercontent.com/u/28600571?s=200&v=4", MimeTypes.IMAGE_PNG)
.download(new DownloadCallback() {
@Override
public void onDownloaded(boolean success, @NotNull ContextIntentHandler contextIntentHandler) {
contextIntentHandler.startActivity();
}
});