Clipboard allows you to use methods getString()
and setString()
to access the system clipboard.
Not long ago, We're still suffering from such a situation that we got a verification code sent by SMS, and we had no way to get the code from the SMS text but to typed it by our hands. How frustrated it is! But now you can enable your app to get the code from the system clipboard by calling clipboard.getString()
.
::: tip
Reads from clipboard.
data
is the return value.Sets the text to clipboard, having the same effect as copying manually.