IT/Android
Kotlin] 안드로이드 이미지 공유하기 // Android share image
깻잎쌈
2021. 3. 21. 21:49
반응형
이미지를 공유합니다,
버튼을 누르면 공유할 수 있는 앱이 나타납니다
button_share.setOnClickListener {
val intent = Intent(Intent.ACTION_SEND)
// 이미지 uri
val uri: Uri = Uri.parse(imgUri.toString())
intent.type = ("image/*")
intent.putExtra(Intent.EXTRA_STREAM, uri)
startActivity(Intent.createChooser(intent, "Share img"))
}
인텐트 이미지 타입을 image/png로 하면 공유가 안되는 앱도 있습니다.
intent.type = ("image/*")
developers.facebook.com/docs/instagram/sharing-to-feed
반응형