public class

ClipDescription

extends Object
implements Parcelable
java.lang.Object
   ↳ android.content.ClipDescription

Class Overview

Meta-data describing the contents of a ClipData. Provides enough information to know if you can handle the ClipData, but not the data itself.

Summary

Constants
String MIMETYPE_TEXT_INTENT The MIME type for a clip holding an Intent.
String MIMETYPE_TEXT_PLAIN The MIME type for a clip holding plain text.
String MIMETYPE_TEXT_URILIST The MIME type for a clip holding one or more URIs.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<ClipDescription> CREATOR
Public Constructors
ClipDescription(CharSequence label, String[] mimeTypes)
Create a new clip.
ClipDescription(ClipDescription o)
Create a copy of a ClipDescription.
Public Methods
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.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final String MIMETYPE_TEXT_INTENT

Since: API Level 11

The MIME type for a clip holding an Intent.

Constant Value: "text/vnd.android.intent"

public static final String MIMETYPE_TEXT_PLAIN

Since: API Level 11

The MIME type for a clip holding plain text.

Constant Value: "text/plain"

public static final String MIMETYPE_TEXT_URILIST

Since: API Level 11

The MIME type for a clip holding one or more URIs. This should be used for URIs that are meaningful to a user (such as an http: URI). It should not be used for a content: URI that references some other piece of data; in that case the MIME type should be the type of the referenced data.

Constant Value: "text/uri-list"

Fields

public static final Creator<ClipDescription> CREATOR

Since: API Level 11

Public Constructors

public ClipDescription (CharSequence label, String[] mimeTypes)

Since: API Level 11

Create a new clip.

Parameters
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)

Since: API Level 11

Create a copy of a ClipDescription.

Public Methods

public static boolean compareMimeTypes (String concreteType, String desiredType)

Since: API Level 11

Helper to compare two MIME types, where one may be a pattern.

Parameters
concreteType A fully-specified MIME type.
desiredType A desired MIME type that may be a pattern such as *\/*.
Returns
  • Returns true if the two MIME types match.

public int describeContents ()

Since: API Level 11

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public String[] filterMimeTypes (String mimeType)

Since: API Level 11

Filter the clip description MIME types by the given MIME type. Returns all MIME types in the clip that match the given MIME type.

Parameters
mimeType The desired MIME type. May be a pattern.
Returns
  • Returns an array of all matching MIME types. If there are no matching MIME types, null is returned.

public CharSequence getLabel ()

Since: API Level 11

Return the label for this clip.

public String getMimeType (int index)

Since: API Level 11

Return one of the possible clip MIME types.

public int getMimeTypeCount ()

Since: API Level 11

Return the number of MIME types the clip is available in.

public boolean hasMimeType (String mimeType)

Since: API Level 11

Check whether the clip description contains the given MIME type.

Parameters
mimeType The desired MIME type. May be a pattern.
Returns
  • Returns true if one of the MIME types in the clip description matches the desired MIME type, else false.

public void writeToParcel (Parcel dest, int flags)

Since: API Level 11

Flatten this object in to a Parcel.

Parameters
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_WRITE_RETURN_VALUE.