目录

ActivityRecordDeleteOptions

Class Info

public class ActivityRecordDeleteOptions

Parameter class for deleting activity records from Health Kit. An activity record includes activityRecordIds, activity start and end times, and subDataTypeList.

The sample code for constructing an ActivityRecordDeleteOptions object is as follows:
Java
// For details about subDataTypeList, startTime, endTime, and activityRecordIds, see the code for deleting activity records.
ActivityRecordDeleteOptions deleteRequest = new ActivityRecordDeleteOptions.Builder()
    .setSubDataTypeList(subDataTypeList)
    .setTimeInterval(startTime, endTime, TimeUnit.MILLISECONDS)
    .setActivityRecordIds(activityRecordIds)
    .build();
Kotlin
// For details about subDataTypeList, startTime, endTime, and activityRecordIds, see the code for deleting activity records.
val deleteRequest = ActivityRecordDeleteOptions.Builder()
    .setSubDataTypeList(subDataTypeList)
    .setTimeInterval(startTime, endTime, TimeUnit.MILLISECONDS)
    .setActivityRecordIds(activityRecordIds)
    .build()

Nested Class Summary

Qualifier and Type

Class Name and Description

public static class

ActivityRecordDeleteOptions.Builder

Builder for ActivityRecordDeleteOptions.

Public Method Summary

Qualifier and Type

Method Name and Description

List<DataType>

getSubDataTypeList()

Obtains the types of detailed data to be deleted.

long

getStartTime(TimeUnit timeUnit)

Obtains the start time of the record to be deleted.

long

getEndTime(TimeUnit timeUnit)

Obtains the end time of the record to be deleted.

List<String>

getActivityRecordIds()

Obtains the IDs of activity records to be deleted.

Public Methods

[h2]getSubDataTypeList()

Method

public List<DataType> getSubDataTypeList()

Obtains the types of detailed data to be deleted.

Returns

Type

Description

List<DataType>

Types of detailed data to be deleted.

[h2]getStartTime(TimeUnit timeUnit)

Method

public long getStartTime(TimeUnit timeUnit)

Obtains the start time of the record to be deleted.

Returns

Type

Description

long

Start time of the record to be deleted.

[h2]getEndTime(TimeUnit timeUnit)

Method

public long getEndTime(TimeUnit timeUnit)

Obtains the end time of the record to be deleted.

Returns

Type

Description

long

End time of the record to be deleted.

[h2]getActivityRecordIds()

Method

public List<String>getActivityRecordIds()

Obtains the IDs of activity records to be deleted.

Returns

Type

Description

List<String>

IDs of activity records to be deleted.