Skip to content

Commit

Permalink
update share button content at DetailActivity.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
riyandifirman committed Mar 5, 2023
1 parent d87c1da commit 6775c66
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ class DetailActivity : AppCompatActivity(), View.OnClickListener {
}

// Set onClickListener untuk button share
val url = "https://github.com/riyandifirman/my-valorant-agent-wiki"
val message = "My Valorant Agent Wiki\n\n" +
"Name: ${binding.tvName.text}\n" +
"${binding.tvRole.text}\n" +
"${binding.tvCountry.text}\n" +
"${binding.tvUltimate.text}\n" +
"Description: ${binding.tvDescription.text}\n"
binding.shareButton.setOnClickListener {
val intent = Intent(Intent.ACTION_SEND)
intent.type = "text/plain"
intent.putExtra(Intent.EXTRA_SUBJECT, "My Valorant Agent Wiki")
intent.putExtra(Intent.EXTRA_TEXT, url)
intent.putExtra(Intent.EXTRA_TEXT, message)
startActivity(Intent.createChooser(intent, "Share via"))
}
}
Expand Down

0 comments on commit 6775c66

Please sign in to comment.