public class ClipDescription extends Object implements Parcelable
ClipData
. Provides enough
information to know if you can handle the ClipData, but not the data
itself.
For more information about using the clipboard framework, read the Copy and Paste developer guide.
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<ClipDescription> |
CREATOR |
static String |
MIMETYPE_TEXT_HTML
The MIME type for a clip holding HTML text.
|
static String |
MIMETYPE_TEXT_INTENT
The MIME type for a clip holding an Intent.
|
static String |
MIMETYPE_TEXT_PLAIN
The MIME type for a clip holding plain text.
|
static String |
MIMETYPE_TEXT_URILIST
The MIME type for a clip holding one or more URIs.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
ClipDescription(CharSequence label,
String[] mimeTypes)
Create a new clip.
|
ClipDescription(ClipDescription o)
Create a copy of a ClipDescription.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
compareMimeTypes(String concreteType,
String desiredType)
Helper to compare two MIME types, where one may be a pattern.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
String[] |
filterMimeTypes(String mimeType)
Filter the clip description MIME types by the given MIME type.
|
CharSequence |
getLabel()
Return the label for this clip.
|
String |
getMimeType(int index)
Return one of the possible clip MIME types.
|
int |
getMimeTypeCount()
Return the number of MIME types the clip is available in.
|
boolean |
hasMimeType(String mimeType)
Check whether the clip description contains the given MIME type.
|
boolean |
toShortString(StringBuilder b) |
String |
toString()
Returns a string containing a concise, human-readable description of this
object.
|
void |
validate() |
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final String MIMETYPE_TEXT_PLAIN
public static final String MIMETYPE_TEXT_HTML
public static final String MIMETYPE_TEXT_URILIST
public static final String MIMETYPE_TEXT_INTENT
public static final Parcelable.Creator<ClipDescription> CREATOR
public ClipDescription(CharSequence label, String[] mimeTypes)
label
- Label to show to the user describing this clip.mimeTypes
- An array of MIME types this data is available as.public ClipDescription(ClipDescription o)
public static boolean compareMimeTypes(String concreteType, String desiredType)
concreteType
- A fully-specified MIME type.desiredType
- A desired MIME type that may be a pattern such as *\/*.public CharSequence getLabel()
public boolean hasMimeType(String mimeType)
mimeType
- The desired MIME type. May be a pattern.public String[] filterMimeTypes(String mimeType)
mimeType
- The desired MIME type. May be a pattern.public int getMimeTypeCount()
public String getMimeType(int index)
public void validate()
public String toString()
Object
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
public boolean toShortString(StringBuilder b)
public int describeContents()
Parcelable
describeContents
in interface Parcelable
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.