# Class SessionSample

java.lang.Object
com.codename1.health.HealthSample
com.codename1.health.SessionSample

Direct Known Subclasses:
  `NutritionSample, SleepSample, WorkoutSample`

public abstract class SessionSample extends HealthSample

A bounded activity that groups child data -- a workout, a night's sleep, a logged meal.

Sessions are always intervals: `HealthSample.isInstantaneous()` is false for every subclass.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `SessionSample(HealthDataType type, long startMillis, long endMillis)`
  Creates a session spanning `[startMillis, endMillis]`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final String`
  `getNotes()`
  Free-form user notes, or null.
  `final String`
  `getTitle()`
  A user-visible title, or null.
  `final void`
  `setNotes(String notes)`
  Sets free-form user notes.
  `final void`
  `setTitle(String title)`
  Sets the user-visible title.

  ### Methods inherited from class HealthSample

  `equals, getDuration, getDurationMillis, getEnd, getEndMillis, getId, getMetadata, getRecordingMethod, getSource, getStart, getStartMillis, getType, hashCode, isInstantaneous, putMetadata, setId, setRecordingMethod, setSource, toString`

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SessionSample

    protected SessionSample(HealthDataType type, long startMillis, long endMillis)
    Creates a session spanning `[startMillis, endMillis]`.

- ## Method Details

  - ### getTitle

    public final String getTitle()
    A user-visible title, or null. Health Connect stores this natively; on iOS it is carried in sample metadata.

  - ### setTitle

    public final void setTitle(String title)
    Sets the user-visible title.

  - ### getNotes

    public final String getNotes()
    Free-form user notes, or null.

  - ### setNotes

    public final void setNotes(String notes)
    Sets free-form user notes.