Код: Выделить всё
private val healthConnectClient by lazy { HealthConnectClient.getOrCreate(context) }
healthConnectClient.insertRecords(
listOf(
ExerciseSessionRecord(
startTime = start.toInstant(),
startZoneOffset = start.offset,
endTime = end.toInstant(),
endZoneOffset = end.offset,
exerciseType = ExerciseSessionRecord.EXERCISE_TYPE_YOGA,
title = "IshaKriya"
)
)
)
Подробнее здесь: https://stackoverflow.com/questions/780 ... th-connect
Мобильная версия