Copy link to clipboard
Copied
I've just ported a little flash game I did on Android, it runs fairly well but sadly when I press the Home\Back button the app freeze and I need to force the exit to quit. What can cause this kind of problem? Could it be AIR garbage collection freezing the whole phone? I don't really know where to bang my head because I can't even debug such a thing as it should be the phone OS itself or at least AIR to manage things like that.
I'm using Flash Buider 4.5 and the device seems to not matter, it does the same on two different devices I tried.
Copy link to clipboard
Copied
It's hard to tell what could be going on without sample code. Could you please open a new bug report on this over at bugbase.adobe.com? Please include any sample code we can use that would help us reproduce the crash on exit. Afterwards, please post back with the URL so that others affected can add their comments and votes.
Thanks,
Chris
Copy link to clipboard
Copied
I got my hands over a Samsung Galaxy S, sadly I have only ios devices so I wasn't able to test my app first hand until now.
This phone has 4 buttons that can make the app go in background, when in background contrariarly to ios, I can still hear the game music playing. It's just like the app is still running even if i can't see it. Maybe I should use the "on focus" functions like I normally do in web based flash games?
Anyway, If I use the button shaped like an upward arrow to background the app, everything works, I can open it again and it works as expected. But when I use the magnifying glass button, or any other button, if I launch my application again I get a black screen. Sometimes Android will tell me that the application has stopped working. Other times, the app freezes completely even before going in background.
I'm going to try to do a little sample application, provice sources and then fill a bug report, thanks
Copy link to clipboard
Copied
Hi,
You can take certain actions depending on whether the app is in foreground / background. For this use NativeApplication to listen on when app is moved to background.
Something like this:
NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onForeground);
NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onBackground);
I assume you are talking about 'Search' button - - "the magnifying glass button". If you dont want to perform any activity on pressing this just ignore it.
Your key listeners would look like this:
import flash.ui.Keyboard;
import flash.events.KeyboardEvent;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);
function onKeyPress(event:KeyboardEvent):void {
switch (event.keyCode) {
case Keyboard.BACK:
/* Perform Activity */
break;
case Keyboard.MENU:
/* Perform Activity */
break;
case Keyboard.SEARCH:
/* You can prevent default activity of android */
event.preventDefault();
break;
}
}
Ignore if you already know these...