1
NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, handleAppActivate);

private function handleAppActivate(e:Event):void
{
    _active = true;
    if (_starling) _starling.start();
    SoundManager.instance.resumeAll();
}

This event is fired after user activates my application. Now what happens on Android is when I press power button to lock screen and again to unlock it, this event is fired and despite I'm still seeing the lock screen that tells me to pull the thing to unlock, my app's music is playing in the background.

Can I wait with the event till the user actually sees the application?

tshepang
  • 12,111
  • 21
  • 91
  • 136
kosmo
  • 175
  • 2
  • 13

1 Answers1

1

In an activity, Befor lock, it calls onPause() and after unlock , It calls onResume(). So you can write your own code in these two functions.

Jithu
  • 1,478
  • 1
  • 13
  • 21
  • Are you meantioning the air or android solution? Because if that worked in android I would have to create a native extension, right? – kosmo May 10 '13 at 12:18
  • I meaned It in android. I had some issues with the same situation and i Found the solution with these functions. You can check It by putting log in these functions – Jithu May 10 '13 at 12:31
  • Ok thank you for response. I've checked it on android, put Log in onResume() and unfortunately it fires right after I click power button, not after I unlock the interface :/ – kosmo May 10 '13 at 12:44
  • I've found out that Intent.ACTION_USER_PRESENT broadcast works as I wanted, now I need to write a native extension – kosmo May 10 '13 at 13:01