problem with new build 484

Hi all, This is my first post so I would like to say hello and thanks to ansca for all their hard work. Using lua is so much easier than java, you guys rock. Also thanks to all the members here for being so helpfull to other members. I almost always find answers to my questions. Anyways I noticed a problem with the new build 484 on my Droid Incredible, with my App and with the new Bubble Ball update. When ever you press the back button on the Incredible and try and go back into the game, the screen goes black. Touch events still work even though the screen goes black and will switch to the levels menu and the screen will show. The only way around this is to kill the process in android task manager and reopen the app.

Can anyone else confirm this.(check out the new bubbleBall)

Thanks again, Jeremy [import]uid: 39088 topic_id: 9100 reply_id: 309100[/import]

We have had users feedback about this and we are looking into this. The code must be updated and looking into adding an API to not make the apps put the device to sleep

c [import]uid: 24 topic_id: 9100 reply_id: 33269[/import]

Cool, Thanks Carlos. You are the Man. :slight_smile: [import]uid: 39088 topic_id: 9100 reply_id: 33318[/import]

For now you can just add the runtime listener and do an os.exit on suspend to quit the game cleanly on sleep etc. [import]uid: 8872 topic_id: 9100 reply_id: 33504[/import]

To fix the problem, add the following code to the end of main.lua. This will perform a screen wake-up. This doesn’t happen on all devices but it won’t hurt using this code on all your Android apps. We are trying to determine why the screen goes blank when you restart the app.

[code]


– Android “restart” Wakeup Code (forces a display update after 250 msec)

– If applicationStart then fire a 250 ms timer.
– After 250 ms, changes the Alpa value of the Current Stage (group)
– This forces a display update to wake up the screen

local function onAndroidSystemEvent( event )

local timerEnd = function()
local t = display.getCurrentStage()
t.alpha = 0.9 – force a display update
timer.performWithDelay( 1, function() t.alpha = 1.0 end ) – wait one frame
end

– Start timer if this is an application start event
if “applicationStart” == event.type then
timer.performWithDelay( 250, timerEnd )
end
end

– Add the System callback event if Android
if “Android” == system.getInfo( “platformName” ) then
Runtime:addEventListener( “system”, onAndroidSystemEvent )
end

[/code] [import]uid: 7559 topic_id: 9100 reply_id: 33509[/import]

Excellent, I was actually curious on how to kill the process when I exit my app. Screen wake will also do me some good. I will give it a both of these ideas a try this evening. As I mentioned before this community is great.

Thanks you guys :slight_smile: [import]uid: 39088 topic_id: 9100 reply_id: 33647[/import]