title: NativeApplication DEACTIVATE-ACTIVATE app when in the background
body: <p>I have made a Flash Air game. While playing it, if I press the Home button on my Android device, I get to the phone's menu yet I still get to listen to the game's music, which means that the game still keeps on fully working.</p>
  
  <p>I would like my app to pause when not in the foreground.</p>
  
  <p>I've seen these codes but apparently I'm doing something wrong cause they aren't working probably...</p>
  
  <pre><code>NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, handleApplicationDeactivated);
  NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, handleApplicationActivated);
  </code></pre>
  
  <p>I've listed the:</p>
  
  <pre><code>import flash.events.Event;
  import flash.desktop.NativeApplication;
  </code></pre>
  
  <p>Could you help me with the proper code?</p>