Код: Выделить всё
class ExerciseSessionRecord
@RestrictTo(RestrictTo.Scope.LIBRARY)
internal constructor(...
Код: Выделить всё
val exerciseSessionRecord = androidx.health.connect.client.records.ExerciseSessionRecord(
startTime = training.startDate.toInstant(),
endTime = training.startDate.toInstant(),
metadata = androidx.health.connect.client.records.metadata.Metadata.autoRecorded(
device = androidx.health.connect.client.records.metadata.Device(type = androidx.health.connect.client.records.metadata.Device.TYPE_PHONE)
),
exerciseType = training.trainingType
)
Код: Выделить всё
val exerciseSessionRecord = androidx.health.connect.client.records.ExerciseSessionRecord(
startTime = training.startDate.toInstant(),
startZoneOffset = null,
endTime = training.startDate.toInstant(),
endZoneOffset = null,
metadata = androidx.health.connect.client.records.metadata.Metadata.autoRecorded(
device = androidx.health.connect.client.records.metadata.Device(type = androidx.health.connect.client.records.metadata.Device.TYPE_PHONE)
),
exerciseType = training.trainingType,
title = training.title,
notes = null,
segments = emptyList(),
laps = emptyList(),
exerciseRoute = null
)
Самое странное, что во всей документации и примерах этот метод упоминается как «публичный», но при просмотре исходного кода это не так.
В этом руководстве описывается процесс записи или обновления данных в Health Connect.
Ошибка компиляции из Android Studio:
ExercisionSessionRecord можно вызвать только из той же библиотеки (androidx.health.connect:connect-client)
Как мне создать PhysicalSessionRecord для хранилище в Health Connect?
Подробнее здесь: https://stackoverflow.com/questions/798 ... th-connect
Мобильная версия