Google 致力于为黑人社区推动种族平等。查看具体举措

ClipboardManager

interface ClipboardManager
androidx.compose.ui.platform.ClipboardManager

Interface for managing the Clipboard.

Summary

Public methods
abstract AnnotatedString?

This method get the text from the Clipboard.

abstract Unit
setText(annotatedString: AnnotatedString)

This method put the text into the Clipboard.

Public methods

getText

abstract fun getText(): AnnotatedString?

This method get the text from the Clipboard.

Return
The text in the Clipboard. It could be null due to 2 reasons: 1. Clipboard is empty; 2. Cannot convert the CharSequence text in Clipboard to AnnotatedString.

setText

abstract fun setText(annotatedString: AnnotatedString): Unit

This method put the text into the Clipboard.

Parameters
annotatedString: AnnotatedString The AnnotatedString to be put into Clipboard.