java.lang.Object | ||
↳ | android.text.ClipboardManager | |
↳ | android.content.ClipboardManager |
Interface to the clipboard service, for placing and retrieving text in the global clipboard.
You do not instantiate this class directly; instead, retrieve it through
getSystemService(String)
.
The ClipboardManager API itself is very simple: it consists of methods
to atomically get and set the current primary clipboard data. That data
is expressed as a ClipData
object, which defines the protocol
for data exchange between applications.
For more information about using the clipboard framework, read the Copy and Paste developer guide.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ClipboardManager.OnPrimaryClipChangedListener | Defines a listener callback that is invoked when the primary clip on the clipboard changes. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the current primary clip on the clipboard.
| |||||||||||
Returns a description of the current primary clip on the clipboard
but not a copy of its data.
| |||||||||||
This method was deprecated
in API level 11.
Use
getPrimaryClip() instead. This retrieves
the primary clip and tries to coerce it to a string.
| |||||||||||
Returns true if there is currently a primary clip on the clipboard.
| |||||||||||
This method was deprecated
in API level 11.
Use
hasPrimaryClip() instead.
| |||||||||||
Sets the current primary clip on the clipboard.
| |||||||||||
This method was deprecated
in API level 11.
Use
setPrimaryClip(ClipData) instead. This
creates a ClippedItem holding the given text and sets it as the
primary clip. It has no label or icon.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.text.ClipboardManager
| |||||||||||
From class
java.lang.Object
|
Returns the current primary clip on the clipboard.
Returns a description of the current primary clip on the clipboard but not a copy of its data.
This method was deprecated
in API level 11.
Use getPrimaryClip()
instead. This retrieves
the primary clip and tries to coerce it to a string.
Returns the text on the clipboard. It will eventually be possible to store types other than text too, in which case this will return null if the type cannot be coerced to text.
Returns true if there is currently a primary clip on the clipboard.
This method was deprecated
in API level 11.
Use hasPrimaryClip()
instead.
Returns true if the clipboard contains text; false otherwise.
Sets the current primary clip on the clipboard. This is the clip that is involved in normal cut and paste operations.
clip | The clipped data item to set. |
---|
This method was deprecated
in API level 11.
Use setPrimaryClip(ClipData)
instead. This
creates a ClippedItem holding the given text and sets it as the
primary clip. It has no label or icon.
Sets the contents of the clipboard to the specified text.