Skip to content

MotionActivityEvent

Activity recognition result delivered to BackgroundGeolocation.onActivityChange.

The SDK fires this event each time the device's motion-activity classifier detects a change in the current activity type (e.g. from still to on_foot). The event includes both the detected activity and the classifier's confidence level.

BackgroundGeolocation.onActivityChange((MotionActivityEvent event) {
  print('[onActivityChange] ${event.activity} ${event.confidence}');
});