Answers for "implement copy in android kotlin"

0

kotlin copy text android 10

fun copyText(text:String){
            val myClipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
            val myClip: ClipData = ClipData.newPlainText("Label", text)
            myClipboard.setPrimaryClip(myClip)
        }
Posted by: Guest on September-01-2020
0

android copy to clipboard programmatically kotlin

//in kotlin
val clipboard = getSystemService(context, ClipboardManager::class.java) as ClipboardManager
        val clip = ClipData.newPlainText("label",text)
        clipboard.setPrimaryClip(clip)
Posted by: Guest on January-25-2022

Browse Popular Code Answers by Language