ActivityIntensityRecord.Builder


public static final class ActivityIntensityRecord.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.ActivityIntensityRecord.Builder


Builder class for ActivityIntensityRecord

Summary

Public constructors

Builder(Metadata metadata, Instant startTime, Instant endTime, int activityIntensityType)

Public methods

ActivityIntensityRecord build()

Returns ActivityIntensityRecord

ActivityIntensityRecord.Builder setEndZoneOffset(ZoneOffset endZoneOffset)

Sets the ZoneOffset of the user when the activity ended.

ActivityIntensityRecord.Builder setStartZoneOffset(ZoneOffset startZoneOffset)

Sets the ZoneOffset of the user when the activity started.

Inherited methods

Public constructors

Builder

Added in API level 36
Also in U Extensions 16
public Builder (Metadata metadata, 
                Instant startTime, 
                Instant endTime, 
                int activityIntensityType)

Parameters
metadata Metadata: Metadata to be associated with the record. See Metadata. This value cannot be null.

startTime Instant: Start time of this activity instensity record. This value cannot be null.

endTime Instant: End time of this activity intensity record. This value cannot be null.

activityIntensityType int: Value is ActivityIntensityRecord.ACTIVITY_INTENSITY_TYPE_MODERATE, or ActivityIntensityRecord.ACTIVITY_INTENSITY_TYPE_VIGOROUS

Public methods

build

Added in API level 36
Also in U Extensions 16
public ActivityIntensityRecord build ()

Returns ActivityIntensityRecord

Returns
ActivityIntensityRecord This value cannot be null.

setEndZoneOffset

Added in API level 36
Also in U Extensions 16
public ActivityIntensityRecord.Builder setEndZoneOffset (ZoneOffset endZoneOffset)

Sets the ZoneOffset of the user when the activity ended.

Defaults to the system zone offset if not set.

Parameters
endZoneOffset ZoneOffset: This value cannot be null.

Returns
ActivityIntensityRecord.Builder This value cannot be null.

setStartZoneOffset

Added in API level 36
Also in U Extensions 16
public ActivityIntensityRecord.Builder setStartZoneOffset (ZoneOffset startZoneOffset)

Sets the ZoneOffset of the user when the activity started.

Defaults to the system zone offset if not set.

Parameters
startZoneOffset ZoneOffset: This value cannot be null.

Returns
ActivityIntensityRecord.Builder This value cannot be null.