Most visited

Recently visited

Added in API level 4

AccessibilityEvent

public final class AccessibilityEvent
extends AccessibilityRecord implements Parcelable

java.lang.Object
   ↳ android.view.accessibility.AccessibilityRecord
     ↳ android.view.accessibility.AccessibilityEvent


This class represents accessibility events that are sent by the system when something notable happens in the user interface. For example, when a Button is clicked, a View is focused, etc.

An accessibility event is fired by an individual view which populates the event with data for its state and requests from its parent to send the event to interested parties. The parent can optionally add an AccessibilityRecord for itself before dispatching a similar request to its parent. A parent can also choose not to respect the request for sending an event. The accessibility event is sent by the topmost view in the view tree. Therefore, an AccessibilityService can explore all records in an accessibility event to obtain more information about the context in which the event was fired.

The main purpose of an accessibility event is to expose enough information for an AccessibilityService to provide meaningful feedback to the user. Sometimes however, an accessibility service may need more contextual information then the one in the event pay-load. In such cases the service can obtain the event source which is an AccessibilityNodeInfo (snapshot of a View state) which can be used for exploring the window content. Note that the privilege for accessing an event's source, thus the window content, has to be explicitly requested. For more details refer to AccessibilityService. If an accessibility service has not requested to retrieve the window content the event will not contain reference to its source. Also for events of type TYPE_NOTIFICATION_STATE_CHANGED the source is never available.

This class represents various semantically different accessibility event types. Each event type has an associated set of related properties. In other words, each event type is characterized via a subset of the properties exposed by this class. For each event type there is a corresponding constant defined in this class. Follows a specification of the event types and their associated properties:

Developer Guides

For more information about creating and processing AccessibilityEvents, read the Accessibility developer guide.

VIEW TYPES

View clicked - represents the event of clicking on a View like Button, CompoundButton, etc.
Type:TYPE_VIEW_CLICKED
Properties:

View long clicked - represents the event of long clicking on a View like Button, CompoundButton, etc
Type:TYPE_VIEW_LONG_CLICKED
Properties:

View selected - represents the event of selecting an item usually in the context of an AdapterView.
Type: TYPE_VIEW_SELECTED
Properties:

View focused - represents the event of focusing a View.
Type: TYPE_VIEW_FOCUSED
Properties:

View text changed - represents the event of changing the text of an EditText.
Type: TYPE_VIEW_TEXT_CHANGED
Properties:

View text selection changed - represents the event of changing the text selection of an EditText.
Type: TYPE_VIEW_TEXT_SELECTION_CHANGED
Properties:

View text traversed at movement granularity - represents the event of traversing the text of a view at a given granularity. For example, moving to the next word.
Type: TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
Properties:

View scrolled - represents the event of scrolling a view. If the source is a descendant of AdapterView the scroll is reported in terms of visible items - the first visible item, the last visible item, and the total items - because the the source is unaware of its pixel size since its adapter is responsible for creating views. In all other cases the scroll is reported as the current scroll on the X and Y axis respectively plus the height of the source in pixels.
Type: TYPE_VIEW_SCROLLED
Properties:

Note: This event type is not dispatched to descendants though View.dispatchPopulateAccessibilityEvent(AccessibilityEvent), hence the event source View and the sub-tree rooted at it will not receive calls to View.onPopulateAccessibilityEvent(AccessibilityEvent). The preferred way to add text content to such events is by setting the contentDescription of the source view.

TRANSITION TYPES

Window state changed - represents the event of opening a PopupWindow, Menu, Dialog, etc.
Type: TYPE_WINDOW_STATE_CHANGED
Properties:

Window content changed - represents the event of change in the content of a window. This change can be adding/removing view, changing a view size, etc.

Note: This event is fired only for the window source of the last accessibility event different from TYPE_NOTIFICATION_STATE_CHANGED and its purpose is to notify clients that the content of the user interaction window has changed.
Type: TYPE_WINDOW_CONTENT_CHANGED
Properties:

Note: This event type is not dispatched to descendants though View.dispatchPopulateAccessibilityEvent(AccessibilityEvent), hence the event source View and the sub-tree rooted at it will not receive calls to View.onPopulateAccessibilityEvent(AccessibilityEvent). The preferred way to add text content to such events is by setting the contentDescription of the source view.

Windows changed - represents the event of changes in the windows shown on the screen such as a window appeared, a window disappeared, a window size changed, a window layer changed, etc.
Type: TYPE_WINDOWS_CHANGED
Properties:

Note: You can retrieve the AccessibilityWindowInfo for the window source of the event via getSource() to get the source node on which then call AccessibilityNodeInfo.getWindow() to get the window. Also all windows on the screen can be retrieved by a call to android.accessibilityservice.AccessibilityService.getWindows().

NOTIFICATION TYPES

Notification state changed - represents the event showing Notification.
Type: TYPE_NOTIFICATION_STATE_CHANGED
Properties:

Note: This event type is not dispatched to descendants though View.dispatchPopulateAccessibilityEvent(AccessibilityEvent), hence the event source View and the sub-tree rooted at it will not receive calls to View.onPopulateAccessibilityEvent(AccessibilityEvent). The preferred way to add text content to such events is by setting the contentDescription of the source view.

EXPLORATION TYPES

View hover enter - represents the event of beginning to hover over a View. The hover may be generated via exploring the screen by touch or via a pointing device.
Type: TYPE_VIEW_HOVER_ENTER
Properties:

View hover exit - represents the event of stopping to hover over a View. The hover may be generated via exploring the screen by touch or via a pointing device.
Type: TYPE_VIEW_HOVER_EXIT
Properties:

Touch interaction start - represents the event of starting a touch interaction, which is the user starts touching the screen.
Type: TYPE_TOUCH_INTERACTION_START
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.

Touch interaction end - represents the event of ending a touch interaction, which is the user stops touching the screen.
Type: TYPE_TOUCH_INTERACTION_END
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.

Touch exploration gesture start - represents the event of starting a touch exploring gesture.
Type: TYPE_TOUCH_EXPLORATION_GESTURE_START
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.

Touch exploration gesture end - represents the event of ending a touch exploring gesture.
Type: TYPE_TOUCH_EXPLORATION_GESTURE_END
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.

Touch gesture detection start - represents the event of starting a user gesture detection.
Type: TYPE_GESTURE_DETECTION_START
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.

Touch gesture detection end - represents the event of ending a user gesture detection.
Type: TYPE_GESTURE_DETECTION_END
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.

MISCELLANEOUS TYPES

Announcement - represents the event of an application making an announcement. Usually this announcement is related to some sort of a context change for which none of the events representing UI transitions is a good fit. For example, announcing a new page in a book.
Type: TYPE_ANNOUNCEMENT
Properties:

Security note

Since an event contains the text of its source privacy can be compromised by leaking sensitive information such as passwords. To address this issue any event fired in response to manipulation of a PASSWORD field does NOT CONTAIN the text of the password.

See also:

Summary

Constants

int CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION

Change type for TYPE_WINDOW_CONTENT_CHANGED event: The node's content description changed.

int CONTENT_CHANGE_TYPE_SUBTREE

Change type for TYPE_WINDOW_CONTENT_CHANGED event: A node in the subtree rooted at the source node was added or removed.

int CONTENT_CHANGE_TYPE_TEXT

Change type for TYPE_WINDOW_CONTENT_CHANGED event: The node's text changed.

int CONTENT_CHANGE_TYPE_UNDEFINED

Change type for TYPE_WINDOW_CONTENT_CHANGED event: The type of change is not defined.

int INVALID_POSITION

Invalid selection/focus position.

int MAX_TEXT_LENGTH

Maximum length of the text fields.

int TYPES_ALL_MASK

Mask for AccessibilityEvent all types.

int TYPE_ANNOUNCEMENT

Represents the event of an application making an announcement.

int TYPE_ASSIST_READING_CONTEXT

Represents the event of the assistant currently reading the users screen context.

int TYPE_GESTURE_DETECTION_END

Represents the event of ending gesture detection.

int TYPE_GESTURE_DETECTION_START

Represents the event of beginning gesture detection.

int TYPE_NOTIFICATION_STATE_CHANGED

Represents the event showing a Notification.

int TYPE_TOUCH_EXPLORATION_GESTURE_END

Represents the event of ending a touch exploration gesture.

int TYPE_TOUCH_EXPLORATION_GESTURE_START

Represents the event of starting a touch exploration gesture.

int TYPE_TOUCH_INTERACTION_END

Represents the event of the user ending to touch the screen.

int TYPE_TOUCH_INTERACTION_START

Represents the event of the user starting to touch the screen.

int TYPE_VIEW_ACCESSIBILITY_FOCUSED

Represents the event of gaining accessibility focus.

int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED

Represents the event of clearing accessibility focus.

int TYPE_VIEW_CLICKED

Represents the event of clicking on a View like Button, CompoundButton, etc.

int TYPE_VIEW_CONTEXT_CLICKED

Represents the event of a context click on a View.

int TYPE_VIEW_FOCUSED

Represents the event of setting input focus of a View.

int TYPE_VIEW_HOVER_ENTER

Represents the event of a hover enter over a View.

int TYPE_VIEW_HOVER_EXIT

Represents the event of a hover exit over a View.

int TYPE_VIEW_LONG_CLICKED

Represents the event of long clicking on a View like Button, CompoundButton, etc.

int TYPE_VIEW_SCROLLED

Represents the event of scrolling a view.

int TYPE_VIEW_SELECTED

Represents the event of selecting an item usually in the context of an AdapterView.

int TYPE_VIEW_TEXT_CHANGED

Represents the event of changing the text of an EditText.

int TYPE_VIEW_TEXT_SELECTION_CHANGED

Represents the event of changing the selection in an EditText.

int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY

Represents the event of traversing the text of a view at a given movement granularity.

int TYPE_WINDOWS_CHANGED

Represents the event change in the windows shown on the screen.

int TYPE_WINDOW_CONTENT_CHANGED

Represents the event of changing the content of a window and more specifically the sub-tree rooted at the event's source.

int TYPE_WINDOW_STATE_CHANGED

Represents the event of opening a PopupWindow, Menu, Dialog, etc.

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<AccessibilityEvent> CREATOR

Public methods

void appendRecord(AccessibilityRecord record)

Appends an AccessibilityRecord to the end of event records.

int describeContents()

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

static String eventTypeToString(int eventType)

Returns the string representation of an event type.

int getAction()

Gets the performed action that triggered this event.

int getContentChangeTypes()

Gets the bit mask of change types signaled by an TYPE_WINDOW_CONTENT_CHANGED event.

long getEventTime()

Gets the time in which this event was sent.

int getEventType()

Gets the event type.

int getMovementGranularity()

Gets the movement granularity that was traversed.

CharSequence getPackageName()

Gets the package name of the source.

AccessibilityRecord getRecord(int index)

Gets the record at a given index.

int getRecordCount()

Gets the number of records contained in the event.

void initFromParcel(Parcel parcel)

Creates a new instance from a Parcel.

static AccessibilityEvent obtain(AccessibilityEvent event)

Returns a cached instance if such is available or a new one is created.

static AccessibilityEvent obtain()

Returns a cached instance if such is available or a new one is instantiated.

static AccessibilityEvent obtain(int eventType)

Returns a cached instance if such is available or a new one is instantiated with its type property set.

void recycle()

Recycles an instance back to be reused.

void setAction(int action)

Sets the performed action that triggered this event.

void setContentChangeTypes(int changeTypes)

Sets the bit mask of node tree changes signaled by an TYPE_WINDOW_CONTENT_CHANGED event.

void setEventTime(long eventTime)

Sets the time in which this event was sent.

void setEventType(int eventType)

Sets the event type.

void setMovementGranularity(int granularity)

Sets the movement granularity that was traversed.

void setPackageName(CharSequence packageName)

Sets the package name of the source.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel parcel, int flags)

Flatten this object in to a Parcel.

Inherited methods

From class android.view.accessibility.AccessibilityRecord
From class java.lang.Object
From interface android.os.Parcelable

Constants

CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION

Added in API level 19
int CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION

Change type for TYPE_WINDOW_CONTENT_CHANGED event: The node's content description changed.

Constant Value: 4 (0x00000004)

CONTENT_CHANGE_TYPE_SUBTREE

Added in API level 19
int CONTENT_CHANGE_TYPE_SUBTREE

Change type for TYPE_WINDOW_CONTENT_CHANGED event: A node in the subtree rooted at the source node was added or removed.

Constant Value: 1 (0x00000001)

CONTENT_CHANGE_TYPE_TEXT

Added in API level 19
int CONTENT_CHANGE_TYPE_TEXT

Change type for TYPE_WINDOW_CONTENT_CHANGED event: The node's text changed.

Constant Value: 2 (0x00000002)

CONTENT_CHANGE_TYPE_UNDEFINED

Added in API level 19
int CONTENT_CHANGE_TYPE_UNDEFINED

Change type for TYPE_WINDOW_CONTENT_CHANGED event: The type of change is not defined.

Constant Value: 0 (0x00000000)

INVALID_POSITION

Added in API level 4
int INVALID_POSITION

Invalid selection/focus position.

See also:

Constant Value: -1 (0xffffffff)

MAX_TEXT_LENGTH

Added in API level 4
int MAX_TEXT_LENGTH

Maximum length of the text fields.

See also:

Constant Value: 500 (0x000001f4)

TYPE_ANNOUNCEMENT

Added in API level 16
int TYPE_ANNOUNCEMENT

Represents the event of an application making an announcement.

Constant Value: 16384 (0x00004000)

TYPE_ASSIST_READING_CONTEXT

Added in API level 23
int TYPE_ASSIST_READING_CONTEXT

Represents the event of the assistant currently reading the users screen context.

Constant Value: 16777216 (0x01000000)

TYPE_GESTURE_DETECTION_END

Added in API level 17
int TYPE_GESTURE_DETECTION_END

Represents the event of ending gesture detection.

Constant Value: 524288 (0x00080000)

TYPE_GESTURE_DETECTION_START

Added in API level 17
int TYPE_GESTURE_DETECTION_START

Represents the event of beginning gesture detection.

Constant Value: 262144 (0x00040000)

TYPE_NOTIFICATION_STATE_CHANGED

Added in API level 4
int TYPE_NOTIFICATION_STATE_CHANGED

Represents the event showing a Notification.

Constant Value: 64 (0x00000040)

TYPE_TOUCH_EXPLORATION_GESTURE_END

Added in API level 14
int TYPE_TOUCH_EXPLORATION_GESTURE_END

Represents the event of ending a touch exploration gesture.

Constant Value: 1024 (0x00000400)

TYPE_TOUCH_EXPLORATION_GESTURE_START

Added in API level 14
int TYPE_TOUCH_EXPLORATION_GESTURE_START

Represents the event of starting a touch exploration gesture.

Constant Value: 512 (0x00000200)

TYPE_TOUCH_INTERACTION_END

Added in API level 17
int TYPE_TOUCH_INTERACTION_END

Represents the event of the user ending to touch the screen.

Constant Value: 2097152 (0x00200000)

TYPE_TOUCH_INTERACTION_START

Added in API level 17
int TYPE_TOUCH_INTERACTION_START

Represents the event of the user starting to touch the screen.

Constant Value: 1048576 (0x00100000)

TYPE_VIEW_ACCESSIBILITY_FOCUSED

Added in API level 16
int TYPE_VIEW_ACCESSIBILITY_FOCUSED

Represents the event of gaining accessibility focus.

Constant Value: 32768 (0x00008000)

TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED

Added in API level 16
int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED

Represents the event of clearing accessibility focus.

Constant Value: 65536 (0x00010000)

TYPE_VIEW_CLICKED

Added in API level 4
int TYPE_VIEW_CLICKED

Represents the event of clicking on a View like Button, CompoundButton, etc.

Constant Value: 1 (0x00000001)

TYPE_VIEW_CONTEXT_CLICKED

Added in API level 23
int TYPE_VIEW_CONTEXT_CLICKED

Represents the event of a context click on a View.

Constant Value: 8388608 (0x00800000)

TYPE_VIEW_FOCUSED

Added in API level 4
int TYPE_VIEW_FOCUSED

Represents the event of setting input focus of a View.

Constant Value: 8 (0x00000008)

TYPE_VIEW_HOVER_ENTER

Added in API level 14
int TYPE_VIEW_HOVER_ENTER

Represents the event of a hover enter over a View.

Constant Value: 128 (0x00000080)

TYPE_VIEW_HOVER_EXIT

Added in API level 14
int TYPE_VIEW_HOVER_EXIT

Represents the event of a hover exit over a View.

Constant Value: 256 (0x00000100)

TYPE_VIEW_LONG_CLICKED

Added in API level 4
int TYPE_VIEW_LONG_CLICKED

Represents the event of long clicking on a View like Button, CompoundButton, etc.

Constant Value: 2 (0x00000002)

TYPE_VIEW_SCROLLED

Added in API level 14
int TYPE_VIEW_SCROLLED

Represents the event of scrolling a view.

Constant Value: 4096 (0x00001000)

TYPE_VIEW_SELECTED

Added in API level 4
int TYPE_VIEW_SELECTED

Represents the event of selecting an item usually in the context of an AdapterView.

Constant Value: 4 (0x00000004)

TYPE_VIEW_TEXT_CHANGED

Added in API level 4
int TYPE_VIEW_TEXT_CHANGED

Represents the event of changing the text of an EditText.

Constant Value: 16 (0x00000010)

TYPE_VIEW_TEXT_SELECTION_CHANGED

Added in API level 14
int TYPE_VIEW_TEXT_SELECTION_CHANGED

Represents the event of changing the selection in an EditText.

Constant Value: 8192 (0x00002000)

TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY

Added in API level 16
int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY

Represents the event of traversing the text of a view at a given movement granularity.

Constant Value: 131072 (0x00020000)

TYPE_WINDOWS_CHANGED

Added in API level 21
int TYPE_WINDOWS_CHANGED

Represents the event change in the windows shown on the screen.

Constant Value: 4194304 (0x00400000)

TYPE_WINDOW_CONTENT_CHANGED

Added in API level 14
int TYPE_WINDOW_CONTENT_CHANGED

Represents the event of changing the content of a window and more specifically the sub-tree rooted at the event's source.

Constant Value: 2048 (0x00000800)

TYPE_WINDOW_STATE_CHANGED

Added in API level 4
int TYPE_WINDOW_STATE_CHANGED

Represents the event of opening a PopupWindow, Menu, Dialog, etc.

Constant Value: 32 (0x00000020)

Fields

CREATOR

Added in API level 4
Creator<AccessibilityEvent> CREATOR

See also:

Public methods

appendRecord

Added in API level 14
void appendRecord (AccessibilityRecord record)

Appends an AccessibilityRecord to the end of event records.

Parameters
record AccessibilityRecord: The record to append.
Throws
IllegalStateException If called from an AccessibilityService.

describeContents

Added in API level 4
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

eventTypeToString

Added in API level 14
String eventTypeToString (int eventType)

Returns the string representation of an event type. For example, TYPE_VIEW_CLICKED is represented by the string TYPE_VIEW_CLICKED.

Parameters
eventType int: The event type
Returns
String The string representation.

getAction

Added in API level 16
int getAction ()

Gets the performed action that triggered this event.

Returns
int The action.

getContentChangeTypes

Added in API level 19
int getContentChangeTypes ()

Gets the bit mask of change types signaled by an TYPE_WINDOW_CONTENT_CHANGED event. A single event may represent multiple change types.

Returns
int The bit mask of change types. One or more of:

getEventTime

Added in API level 4
long getEventTime ()

Gets the time in which this event was sent.

Returns
long The event time.

getEventType

Added in API level 4
int getEventType ()

Gets the event type.

Returns
int The event type.

getMovementGranularity

Added in API level 16
int getMovementGranularity ()

Gets the movement granularity that was traversed.

Returns
int The granularity.

getPackageName

Added in API level 4
CharSequence getPackageName ()

Gets the package name of the source.

Returns
CharSequence The package name.

getRecord

Added in API level 14
AccessibilityRecord getRecord (int index)

Gets the record at a given index.

Parameters
index int: The index.
Returns
AccessibilityRecord The record at the specified index.

getRecordCount

Added in API level 14
int getRecordCount ()

Gets the number of records contained in the event.

Returns
int The number of records.

initFromParcel

Added in API level 4
void initFromParcel (Parcel parcel)

Creates a new instance from a Parcel.

Parameters
parcel Parcel: A parcel containing the state of a AccessibilityEvent.

obtain

Added in API level 14
AccessibilityEvent obtain (AccessibilityEvent event)

Returns a cached instance if such is available or a new one is created. The returned instance is initialized from the given event.

Parameters
event AccessibilityEvent: The other event.
Returns
AccessibilityEvent An instance.

obtain

Added in API level 4
AccessibilityEvent obtain ()

Returns a cached instance if such is available or a new one is instantiated.

Returns
AccessibilityEvent An instance.

obtain

Added in API level 4
AccessibilityEvent obtain (int eventType)

Returns a cached instance if such is available or a new one is instantiated with its type property set.

Parameters
eventType int: The event type.
Returns
AccessibilityEvent An instance.

recycle

Added in API level 4
void recycle ()

Recycles an instance back to be reused.

Note: You must not touch the object after calling this function.

Throws
IllegalStateException If the event is already recycled.

setAction

Added in API level 16
void setAction (int action)

Sets the performed action that triggered this event.

Valid actions are defined in AccessibilityNodeInfo:

Parameters
action int: The action.
Throws
IllegalStateException If called from an AccessibilityService.

See also:

setContentChangeTypes

Added in API level 19
void setContentChangeTypes (int changeTypes)

Sets the bit mask of node tree changes signaled by an TYPE_WINDOW_CONTENT_CHANGED event.

Parameters
changeTypes int: The bit mask of change types.
Throws
IllegalStateException If called from an AccessibilityService.

See also:

setEventTime

Added in API level 4
void setEventTime (long eventTime)

Sets the time in which this event was sent.

Parameters
eventTime long: The event time.
Throws
IllegalStateException If called from an AccessibilityService.

setEventType

Added in API level 4
void setEventType (int eventType)

Sets the event type.

Parameters
eventType int: The event type.
Throws
IllegalStateException If called from an AccessibilityService.

setMovementGranularity

Added in API level 16
void setMovementGranularity (int granularity)

Sets the movement granularity that was traversed.

Parameters
granularity int: The granularity.
Throws
IllegalStateException If called from an AccessibilityService.

setPackageName

Added in API level 4
void setPackageName (CharSequence packageName)

Sets the package name of the source.

Parameters
packageName CharSequence: The package name.
Throws
IllegalStateException If called from an AccessibilityService.

toString

Added in API level 4
String toString ()

Returns a string representation of the object. In general, the 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())
 

Returns
String a string representation of the object.

writeToParcel

Added in API level 4
void writeToParcel (Parcel parcel, 
                int flags)

Flatten this object in to a Parcel.

Parameters
parcel Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!