The ClipboardManager
interface was deprecated. What should I change?
Answer
The ClipboardManager
interface was deprecated in favor of Clipboard
interface.
Change all
import androidx.compose.ui.platform.LocalClipboardManager
toimport androidx.compose.ui.platform.LocalClipboard
andLocalClipboardManager
toLocalClipboard
Make the caller function
suspend
or userememberCoroutineScope().launch { ... }
If you were using function
setText(AnnotatedString(text))
, then you can replace it withsetClipEntry(ClipEntry(ClipData.newPlainText(text, text)))