ti.foreground event is generated each time the activity calls the
onResume() method. The event is queued and is only sent if this is not the first event, and the
ti.background event has not been generated recently. If a
ti.background event was processed within the last 30 seconds*, this indicates that a new activity is being opened on top of an the old activity. A possible scenario is if you hit the Home button, then reopen the app quickly, resulting in a
ti.foreground event to be placed on top of a
ti.background event. In this case, both events are removed from the queue, and the current session is still active.