Array

Audio and Application Activity

Must Read

Admin
Admin
Just post!

The Android Activity Manager controls applications moving to the foreground or the background based on the user’s decision, but doesn’t terminate them.

When your application goes to the background, most processes are paused, but audio and timers continue to run. Unless you want your audio to keep playing, you need to listen to two events to monitor a play and pause scenario:

[code]

import flash.desktop.NativeApplication;
import flash.events.Event;
NativeApplication.nativeApplication.addEventListener
(Event.ACTIVATE, onActivate);
NativeApplication.nativeApplication.addEventListener
(Event.DEACTIVATE, onDeactivate);
function onDeactivate(event:Event):void {
// pause or stop audio
}
function onActivate(event:Event):void {
// play audio
}

[/code]

Previous articleRaw Data and the Sound Spectrum
Next articleVideo
- Advertisement -

Latest News

Elevate Your Bentley Experience: The Bespoke Elegance of Bentayga EWB by Mulliner

Bentley Motors redefines the essence of bespoke luxury with the introduction of the Bentayga EWB's groundbreaking two-tone customization option—a...
- Advertisement -

More Articles Like This

- Advertisement -