From 6775c66abd2b6d9d0cd7f6a63c1352057a440fe8 Mon Sep 17 00:00:00 2001 From: riyandifirman Date: Mon, 6 Mar 2023 00:58:06 +0700 Subject: [PATCH] update share button content at DetailActivity.kt --- .../riyandifirman/myvalorantagentwiki/DetailActivity.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/riyandifirman/myvalorantagentwiki/DetailActivity.kt b/app/src/main/java/com/riyandifirman/myvalorantagentwiki/DetailActivity.kt index c1ad5d9..f9fee76 100644 --- a/app/src/main/java/com/riyandifirman/myvalorantagentwiki/DetailActivity.kt +++ b/app/src/main/java/com/riyandifirman/myvalorantagentwiki/DetailActivity.kt @@ -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")) } }