onStart method

  1. @override
void onStart()
override

Callback from the app when this task is to be started.

Implementation

@override
void onStart() {
  super.onStart();

  // start collecting sensor data in the background
  backgroundTaskExecutor.start();
}