If your app has a long gibberish text like Bitcoin address or Ethereum address. Best to put a button to copy the entire string to clipboard rather than letting the user manually copying it.
val editText: EditText = findViewById(R.id.editText)
val clipboardManager = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val button: ImageButton = findViewById(R.id.imageButton)
button.setOnClickListener {
val text = editText.text
val clipData = ClipData.newPlainText("text", text)
clipboardManager.setPrimaryClip(clipData)
Toast.makeText(this, "Copied to clipboard", Toast.LENGTH_LONG).show()
}