Hi,
I dont find that function to be used to force the display of a datafiled in "onStop()". I want something like "recovery time" screen when save an activity.
Does anyone know how to do it?
Thanks
you can use the startTime value of the Activity.Info that is passed to your data field to determine when a session is started.
//! called when recording is stopped
function onTimerStop() {
}
//! called when recording is started
function onTimerStart() {
}
//! called when recording is paused
function onTimerPause() {
}
//! called when recording is resumed
function onTimerResume() {
}
hidden var elapsedDistance;
hidden var timerTime;
hidden var timerPaused;
function compute(info) {
//
// handle stop/start of the activity recording session
//
if (elapsedDistance == null && info.elapsedDistance != null) {
onTimerStart();
}
else if (elapsedDistance != null && info.elapsedDistance == null) {
onTimerStop();
}
elapsedDistance = info.elapsedDistance;
//
// handle pause/resume due to auto-pause or button press
//
if (timerTime == null) {
timerPaused = false;
}
else if (timerTime == info.timerTime) {
if (!timerPaused) {
onTimerPause();
}
timerPaused = true;
}
else if (timerTime != info.timerTime) {
if (timerPaused) {
onTimerResume();
}
timerPaused = false;
}
timerTime = info.timerTime;
// your other code
}