Goal.Recurrence
Stay organized with collections
Save and categorize content based on your preferences.
A recurrence period of a recurring goal.
Nested Class Summary
@interface
Unit of a recurrence.
Constant Summary
int |
UNIT_DAY
|
Unit constant representing a day. |
int |
UNIT_MONTH
|
Unit constant representing a month. |
int |
UNIT_WEEK
|
Unit constant representing a week. |
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Constructor Summary
Public Method Summary
boolean |
|
int |
getCount
() Returns the count of unit of the recurrence.
|
int |
getUnit
() Returns the unit of the recurrence.
|
int |
|
String
|
|
void |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Constants
public static final int
UNIT_DAY
Unit constant representing a day.
Constant Value:
1
public static final int
UNIT_MONTH
Unit constant representing a month.
Constant Value:
3
public static final int
UNIT_WEEK
Unit constant representing a week.
Constant Value:
2
Public Constructors
public
Recurrence
(int count, int
unit)
Public Methods
public boolean
equals
( Object
other)
public int
getCount
()
Returns the count of unit of the recurrence. For example, it would return '3' for a
goal that recurs every 3 days.
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\u003eGoal.Recurrence\u003c/code\u003e defines the recurring period of a recurring fitness goal, such as daily, weekly, or monthly.\u003c/p\u003e\n"],["\u003cp\u003eIt uses constants like \u003ccode\u003eUNIT_DAY\u003c/code\u003e, \u003ccode\u003eUNIT_WEEK\u003c/code\u003e, and \u003ccode\u003eUNIT_MONTH\u003c/code\u003e to represent the recurrence unit.\u003c/p\u003e\n"],["\u003cp\u003eYou can get the recurrence count (e.g., 3 for every 3 days) and unit using \u003ccode\u003egetCount()\u003c/code\u003e and \u003ccode\u003egetUnit()\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGoal.Recurrence\u003c/code\u003e implements \u003ccode\u003eParcelable\u003c/code\u003e for easy data transfer between components.\u003c/p\u003e\n"]]],[],null,["# Goal.Recurrence\n\npublic static class **Goal.Recurrence** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nA recurrence period of a recurring goal. \n\n### Nested Class Summary\n\n|------------|---|---|-----------------------|\n| @interface | [Goal.Recurrence.RecurrenceUnit](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence.RecurrenceUnit) || Unit of a recurrence. |\n\n### Constant Summary\n\n|-----|-------------------------------------------------------------------------------------------------|-------------------------------------|\n| int | [UNIT_DAY](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#UNIT_DAY) | Unit constant representing a day. |\n| int | [UNIT_MONTH](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#UNIT_MONTH) | Unit constant representing a month. |\n| int | [UNIT_WEEK](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#UNIT_WEEK) | Unit constant representing a week. |\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[Goal.Recurrence](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#CREATOR) | |\n\n### Public Constructor Summary\n\n|---|----------------------------------------------------------------------------------------------------------------------------------|\n| | [Recurrence](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#Recurrence(int,%20int))(int count, int unit) |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) |\n| int | [getCount](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#getCount())() Returns the count of unit of the recurrence. |\n| int | [getUnit](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#getUnit())() Returns the unit of the recurrence. |\n| int | [hashCode](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#hashCode())() |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#toString())() |\n| void | [writeToParcel](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#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\nConstants\n---------\n\n#### public static final int\n**UNIT_DAY**\n\nUnit constant representing a day. \nConstant Value: 1 \n\n#### public static final int\n**UNIT_MONTH**\n\nUnit constant representing a month. \nConstant Value: 3 \n\n#### public static final int\n**UNIT_WEEK**\n\nUnit constant representing a week. \nConstant Value: 2\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[Goal.Recurrence](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence)\\\u003e\n**CREATOR**\n\nPublic Constructors\n-------------------\n\n#### public **Recurrence** (int count, int unit)\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) other)\n\n#### public int **getCount** ()\n\nReturns the count of unit of the recurrence. For example, it would return '3' for a\ngoal that recurs every 3 days. \n\n#### public int **getUnit** ()\n\nReturns the unit of the recurrence. The unit should be one of [UNIT_DAY](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#UNIT_DAY),\n[UNIT_WEEK](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#UNIT_WEEK) and [UNIT_MONTH](/android/reference/com/google/android/gms/fitness/data/Goal.Recurrence#UNIT_MONTH). \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)"]]