Added in API level 34
SexualActivityRecord.Builder
public
static
final
class
SexualActivityRecord.Builder
extends Object
java.lang.Object | |
↳ | android.health.connect.datatypes.SexualActivityRecord.Builder |
Builder class for SexualActivityRecord
Summary
Public constructors | |
---|---|
Builder(Metadata metadata, Instant time, int protectionUsed)
|
Public methods | |
---|---|
SexualActivityRecord
|
build()
|
SexualActivityRecord.Builder
|
clearZoneOffset()
Sets the zone offset of this record to system default. |
SexualActivityRecord.Builder
|
setZoneOffset(ZoneOffset zoneOffset)
Sets the zone offset of the user when the activity happened |
Inherited methods | |
---|---|
Public constructors
Builder
Added in API level 34
public Builder (Metadata metadata, Instant time, int protectionUsed)
Parameters | |
---|---|
metadata |
Metadata : Metadata to be associated with the record. See Metadata .
This value cannot be null . |
time |
Instant : Start time of this activity
This value cannot be null . |
protectionUsed |
int : Whether protection was used during sexual activity. Optional field,
null if unknown. Allowed values: Protection.
Value is SexualActivityRecord.SexualActivityProtectionUsed.PROTECTION_USED_UNKNOWN , SexualActivityRecord.SexualActivityProtectionUsed.PROTECTION_USED_PROTECTED , or SexualActivityRecord.SexualActivityProtectionUsed.PROTECTION_USED_UNPROTECTED |
Public methods
build
Added in API level 34
public SexualActivityRecord build ()
Returns | |
---|---|
SexualActivityRecord |
Object of SexualActivityRecord
This value cannot be null . |
clearZoneOffset
Added in API level 34
public SexualActivityRecord.Builder clearZoneOffset ()
Sets the zone offset of this record to system default.
Returns | |
---|---|
SexualActivityRecord.Builder |
This value cannot be null . |
setZoneOffset
Added in API level 34
public SexualActivityRecord.Builder setZoneOffset (ZoneOffset zoneOffset)
Sets the zone offset of the user when the activity happened
Parameters | |
---|---|
zoneOffset |
ZoneOffset : This value cannot be null . |
Returns | |
---|---|
SexualActivityRecord.Builder |
This value cannot be null . |