Created
December 30, 2017 23:53
-
-
Save Danil0v3s/a01e2896a4dde803e757c0b1ea17aacc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doAsync { | |
val imagem = Glide.with(this@BookActivity).downloadOnly().load(book.LargeImage).submit().get() | |
if (imagem != null) { | |
val uri = getUriForFile(this@BookActivity, this@BookActivity.getPackageName() + ".util.ImageFileProvider", imagem) | |
val intent = Intent(Intent.ACTION_SEND) | |
intent.type = "image/jpeg" | |
intent.putExtra(Intent.EXTRA_SUBJECT, "Compartilhar") | |
intent.putExtra(Intent.EXTRA_TEXT, "${it.ItemAttributes.Title} - ${it.ItemAttributes.Author} por ${it.ItemAttributes.ListPrice[0].price} em ${it.ItemAttributes.ListPrice[0].store}") | |
intent.putExtra(Intent.EXTRA_STREAM, uri) | |
startActivity(Intent.createChooser(intent, "Compartilhar")) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment