Skip to content

Instantly share code, notes, and snippets.

@Danil0v3s
Created December 30, 2017 23:53
Show Gist options
  • Save Danil0v3s/a01e2896a4dde803e757c0b1ea17aacc to your computer and use it in GitHub Desktop.
Save Danil0v3s/a01e2896a4dde803e757c0b1ea17aacc to your computer and use it in GitHub Desktop.
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