public static class ActivityManager.TaskDescription extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_TASKDESCRIPTION_PREFIX |
static Parcelable.Creator<ActivityManager.TaskDescription> |
CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
TaskDescription()
Creates an empty TaskDescription.
|
TaskDescription(ActivityManager.TaskDescription td)
Creates a copy of another TaskDescription.
|
TaskDescription(String label)
Creates the TaskDescription to the specified values.
|
TaskDescription(String label,
Bitmap icon)
Creates the TaskDescription to the specified values.
|
TaskDescription(String label,
Bitmap icon,
int colorPrimary)
Creates the TaskDescription to the specified values.
|
TaskDescription(String label,
Bitmap icon,
String iconFilename,
int colorPrimary,
int colorBackground) |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(ActivityManager.TaskDescription other)
Copies this the values from another TaskDescription.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
int |
getBackgroundColor() |
Bitmap |
getIcon() |
String |
getIconFilename() |
Bitmap |
getInMemoryIcon() |
String |
getLabel() |
int |
getPrimaryColor() |
static Bitmap |
loadTaskDescriptionIcon(String iconFilename,
int userId) |
void |
readFromParcel(Parcel source) |
void |
restoreFromXml(String attrName,
String attrValue) |
void |
saveToXml(XmlSerializer out) |
void |
setBackgroundColor(int backgroundColor)
Sets the background color for this task description.
|
void |
setIcon(Bitmap icon)
Sets the icon for this task description.
|
void |
setIconFilename(String iconFilename)
Moves the icon bitmap reference from an actual Bitmap to a file containing the
bitmap.
|
void |
setLabel(String label)
Sets the label for this task description.
|
void |
setPrimaryColor(int primaryColor)
Sets the primary color for this task description.
|
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public static final String ATTR_TASKDESCRIPTION_PREFIX
public static final Parcelable.Creator<ActivityManager.TaskDescription> CREATOR
public TaskDescription(String label, Bitmap icon, int colorPrimary)
label
- A label and description of the current state of this task.icon
- An icon that represents the current state of this task.colorPrimary
- A color to override the theme's primary color. This color must be
opaque.public TaskDescription(String label, Bitmap icon)
label
- A label and description of the current state of this activity.icon
- An icon that represents the current state of this activity.public TaskDescription(String label)
label
- A label and description of the current state of this activity.public TaskDescription()
public TaskDescription(String label, Bitmap icon, String iconFilename, int colorPrimary, int colorBackground)
public TaskDescription(ActivityManager.TaskDescription td)
public void copyFrom(ActivityManager.TaskDescription other)
public void setLabel(String label)
public void setPrimaryColor(int primaryColor)
public void setBackgroundColor(int backgroundColor)
public void setIcon(Bitmap icon)
public void setIconFilename(String iconFilename)
public String getLabel()
public Bitmap getIcon()
public String getIconFilename()
public Bitmap getInMemoryIcon()
public static Bitmap loadTaskDescriptionIcon(String iconFilename, int userId)
public int getPrimaryColor()
public int getBackgroundColor()
public void saveToXml(XmlSerializer out) throws IOException
IOException
public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
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
.public void readFromParcel(Parcel source)
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())