ActivityTransitionEvent
Stay organized with collections
Save and categorize content based on your preferences.
Represents an activity transition event, for example start to walk, stop running etc.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Constructor Summary
|
ActivityTransitionEvent(int activityType, int transitionType, long
elapsedRealtimeNanos)
Creates an activity transition event.
|
Public Method Summary
boolean |
|
int |
|
long |
|
int |
|
int |
|
String
|
|
void |
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
From interface android.os.Parcelable
abstract int |
describeContents()
|
abstract void |
writeToParcel( Parcel arg0,
int arg1)
|
Public Constructors
public ActivityTransitionEvent (int
activityType, int transitionType, long elapsedRealtimeNanos)
Creates an activity transition event.
Parameters
activityType |
the type of the activity of this transition |
transitionType |
the type of transition |
elapsedRealtimeNanos |
the elapsed realtime when this transition happened |
Public Methods
public boolean equals (Object object)
public int getActivityType ()
Gets the type of the activity of this transition. It's one of activity types defined
in DetectedActivity
.
public long getElapsedRealTimeNanos ()
Gets the elapsed realtime when this transition happened. Note that the event may
happen in the past which means this timestamp may be much smaller than the current
time.
public int getTransitionType ()
Gets the type of the transition. It's one of the transition types defined in
ActivityTransition
.
public void writeToParcel (Parcel dest, int
flags)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eActivityTransitionEvent\u003c/code\u003e represents an activity transition event like starting to walk or stopping running, and implements \u003ccode\u003eParcelable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to access the activity type, transition type, and elapsed time of the transition.\u003c/p\u003e\n"],["\u003cp\u003eActivity types are defined in \u003ccode\u003eDetectedActivity\u003c/code\u003e, while transition types are defined in \u003ccode\u003eActivityTransition\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can create an \u003ccode\u003eActivityTransitionEvent\u003c/code\u003e using its constructor, providing the activity type, transition type, and elapsed time in nanoseconds.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes methods for Parcelable implementation and standard object methods like \u003ccode\u003eequals\u003c/code\u003e, \u003ccode\u003ehashCode\u003c/code\u003e, and \u003ccode\u003etoString\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ActivityTransitionEvent\n\npublic class **ActivityTransitionEvent** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nRepresents an activity transition event, for example start to walk, stop running etc. \n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Field Summary\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|---|\n| public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[ActivityTransitionEvent](/android/reference/com/google/android/gms/location/ActivityTransitionEvent)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#CREATOR) | |\n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [ActivityTransitionEvent](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#ActivityTransitionEvent(int,%20int,%20long))(int activityType, int transitionType, long elapsedRealtimeNanos) Creates an activity transition event. |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) object) |\n| int | [getActivityType](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#getActivityType())() Gets the type of the activity of this transition. |\n| long | [getElapsedRealTimeNanos](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#getElapsedRealTimeNanos())() Gets the elapsed realtime when this transition happened. |\n| int | [getTransitionType](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#getTransitionType())() Gets the type of the transition. |\n| int | [hashCode](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#hashCode())() |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#toString())() |\n| void | [writeToParcel](/android/reference/com/google/android/gms/location/ActivityTransitionEvent#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) dest, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[ActivityTransitionEvent](/android/reference/com/google/android/gms/location/ActivityTransitionEvent)\\\u003e\n**CREATOR**\n\nPublic Constructors\n-------------------\n\n#### public **ActivityTransitionEvent** (int activityType, int transitionType, long elapsedRealtimeNanos)\n\nCreates an activity transition event. \n\n##### Parameters\n\n| activityType | the type of the activity of this transition |\n| transitionType | the type of transition |\n| elapsedRealtimeNanos | the elapsed realtime when this transition happened |\n|----------------------|----------------------------------------------------|\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) object)\n\n#### public int **getActivityType** ()\n\nGets the type of the activity of this transition. It's one of activity types defined\nin [DetectedActivity](/android/reference/com/google/android/gms/location/DetectedActivity). \n\n#### public long **getElapsedRealTimeNanos** ()\n\nGets the elapsed realtime when this transition happened. Note that the event may\nhappen in the past which means this timestamp may be much smaller than the current\ntime. \n\n#### public int **getTransitionType** ()\n\nGets the type of the transition. It's one of the transition types defined in\n[ActivityTransition](/android/reference/com/google/android/gms/location/ActivityTransition). \n\n#### public int **hashCode** ()\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()\n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) dest, int flags)"]]