Recently, I've been getting warnings about the ClipboardManager in Android being deprecated, see: [https://developer.android.com/reference/android/content/ClipboardManager#setText(java.lang.CharSequence)](https://developer.android.com/reference/android/content/ClipboardManager#setText(java.lang.CharSequence))
Previous I had some code something like this for copying a UUID to the clipboard:
```
val clipboardManager = LocalClipboardManager.current
Box(modifier = Modifier.clickable {
clipboardManager.setText(AnnotatedString(uuid))
}
```
However, searching for how to fix this hasn't really turned up much. Looking at the APIs, it looks like this is the way:
```
val clipboard = LocalClipboard.current
val scope = rememberCoroutineScope()
Box(modifier = Modifier.clickable {
scope.launch {
val clipData = ClipData.newPlainText(uuid, uuid)
clipboard.setClipEntry(clipData.toClipEntry())
}
}
```